Coder Social home page Coder Social logo

radekbusa / angular-loading-indicators-the-right-way Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 2.0 16 KB

Created with StackBlitz ⚡️

Home Page: https://stackblitz.com/edit/angular-loading-indicators-the-right-way

HTML 10.77% TypeScript 83.47% CSS 5.77%

angular-loading-indicators-the-right-way's People

Contributors

radekbusa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

angular-loading-indicators-the-right-way's Issues

Loading Indicator on Parent Component

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.