Giter Club home page Giter Club logo

Comments (12)

victos avatar victos commented on September 2, 2024 1

Hi @michaelblum
I made a example here, it works well.

from angular-opensource.

victos avatar victos commented on September 2, 2024 1

No, it's because I create config use this

busyConfig: IBusyConfig = new BusyConfig();

if I pass this to the ngBusy, the template in busyConfig will replace the template setted here

NgBusyModule.forRoot({
      template: MySpinnerComponent
    }),

I've update the demo, you can see the full demo here

The exception ExpressionChangedAfterItHasBeenCheckedError is because I create the busy in ngDoCheck, but it can be ignore here, I'll try to remove the Error in the next release.

from angular-opensource.

michaelblum avatar michaelblum commented on September 2, 2024

Oh thank you! I see that does work for individual components. However, I am attempting to make the mat-spinner template work across my entire application (rather than creating a busyConfig in each sub component that has a busy indicator) thus:
imports: [
...
NgBusyModule.forRoot(new BusyConfig({
template: MySpinnerComponent
}))
]

which IS showing the spinner application-wide however I am also getting the following error for each initialization of each instance of the busy component:
ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '_mat-animation-noopable: undefined'. Current value: '_mat-animation-noopable: false'. It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook ?

from angular-opensource.

michaelblum avatar michaelblum commented on September 2, 2024

Something like this

from angular-opensource.

victos avatar victos commented on September 2, 2024

Hi @michaelblum
The parameter of directive ngBusy is required, that means that we can't remove the variable busyConfig , the full demo is here

export class NgBusyTestComponent implements OnInit {

  busyConfig: IBusyConfig = new BusyConfig();
  constructor() { }

  ngOnInit() {
  }

  onClick() {
    const busy = new Promise<any>((resolve) => {
      setTimeout(() => {
        resolve();
      }, 5000);
    });
    this.busyConfig.busy = [busy];
  }
}

from angular-opensource.

michaelblum avatar michaelblum commented on September 2, 2024

The demo you just cited, while incorporating the mat-spinner in MySpinnerComponent's template, is not showing the mat-spinner but rather the NGBusy default spinner.

from angular-opensource.

michaelblum avatar michaelblum commented on September 2, 2024

Yes, it's strange that the demo you provided is now showing the default spinner with 'Please wait...'

from angular-opensource.

michaelblum avatar michaelblum commented on September 2, 2024

I think the problem may be that you are creating the Busy in ngDoCheck?

from angular-opensource.

Dona278 avatar Dona278 commented on September 2, 2024

I have the same issue..

from angular-opensource.

victos avatar victos commented on September 2, 2024

fixed in the latest release (6.1.0)

from angular-opensource.

edjm1971 avatar edjm1971 commented on September 2, 2024

fixed in the latest release (6.1.0)

victos, I know this is an old post but I'm new with Angular and am struggling with stupid things. For example, how is it that the top spinner is being displayed over the click button when the ngBusy layer is defined below it?

<button mat-button (click)="onClick()">Click me!


...

from angular-opensource.

edjm1971 avatar edjm1971 commented on September 2, 2024

Also, how the heck can you alter the template to be something other than the spinner default. I'm trying to use this with a http request where once the call is made the spinner with backdrop loads over the form until the promise subscribe has returned and executed. Appreciate any info you can provide.

from angular-opensource.

Related Issues (20)

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.