简体   繁体   中英

How to disable mat-spinner out animation

The Angular Material spinner that i have implemented has got an animation out which makes it go down before vanishing. Is there a way to unable this animation? This is the code: I tried with the keyframes but it doesn't work.

<mat-spinner style="margin: auto; margin-top: 10%"></mat-spinner>

  @keyframes slideDown {
    0% {}
    100% {
        transform: translateY(20%);
    }
}

.cdk-overlay-pane {
    transform: translateY(-250%);
    animation: slideDown 0.5s forwards 0s ease-in;
}

.cdk-overlay-container>* {
    transition: none;
}

Add " BrowserAnimationsModule " in your @NgModule imports array, and remove "NoopAnimationsModule" if you have it there.

@NgModule({
declarations: [..],
imports: [
    ..
    BrowserAnimationsModule,
    ..
]
})

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