简体   繁体   中英

Angular Material Progress Spinner not animated

I am trying to add an indeterminate spinner from Angular Material. I checked the official stack blitz example https://stackblitz.com/angular/nkabnxaenep . I compared the package jsons and cant find any differences. a am ahead a few minor versions. The determinate mode works though... I imported the correct module and there are no errors at runtime.

<mat-spinner mode="indeterminate"></mat-spinner>

不工作的微调器图像

Any ideas? Tell me if you need more information.

To enable the animations of Angular Material you have to import the BrowserAnimationsModule into your AppModule as mentioned in the 2nd step of the getting started guide .

imports: [
    BrowserModule,
    BrowserAnimationsModule,
    // NoopAnimationsModule,
    ...

Like @Robin De Schepper suggested, the solution is to add BrowserAnimationsModule to app.module.ts

like this:

imports: [
    BrowserModule,
    BrowserAnimationsModule,
    // NoopAnimationsModule,
    ...

NOTE: For the newer versions of Angular, if you have NoopAnimationsModule in your imports array, you must comment/remove it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM