radekbusa / angular-loading-indicators-the-right-way Goto Github PK
View Code? Open in Web Editor NEWCreated with StackBlitz ⚡️
Home Page: https://stackblitz.com/edit/angular-loading-indicators-the-right-way
Created with StackBlitz ⚡️
Home Page: https://stackblitz.com/edit/angular-loading-indicators-the-right-way
This is a great tutorial and is helping me replace 2 third-party libraries that I was using for loading indicators.
I'm having a bit of a problem getting the loading indicator to display on a parent component when the service is initiated from a child component though. The functionality works...no errors...I just can't see the loading indicator.
I injected the parent component into the child constructor using:
@Optional() protected parentComponent: CompanySettingsComponent,
then I'm calling the service using:
this.loadingService.doLoading( this.companyService.getCompanySettings(), this.parentComponent ?? this ).pipe( untilDestroyed(this) ) .subscribe(response => { ... }); }
Normal setup on a single component works perfectly, so I know it's configured properly.
The only thing I can think of that the child component is one of the tabs in an ng-bootstrap tab set and perhaps that is preventing the spinner from appearing because the directive is attempting to add the loading-overlay class to the tab output div instead of around the parent component.
If you have any suggestions for using this with ng-bootstrap tab set, it would be appreciated. Otherwise I'll just display the spinner directly in the child component. I was trying to put it in the parent component because the tab set is a vertical tab list on the left with the content on the right and the spinner is off-center if it displays in the child component.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.