[英]How to enable Angular animations?
我已經通過教程( https://angular.io/guide/animations )完成了所有工作,但我有錯誤: menu-navigation.component.html:1 ERROR Error: Found the synthetic property @slideTop. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.
menu-navigation.component.html:1 ERROR Error: Found the synthetic property @slideTop. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.
我閱讀了有關它的一切,但沒有找到解決方法的答案。
文件:
所以我做了:
我試過了:
伙計們,幫幫我:)我已經被困了幾天了。
更新: 最后,我在測試一個新的空項目后找到了答案
如果您為組件(prop)定義了“動畫”,那么您只能在其組件(它自己的html)中使用它們,但不能在父布局中使用它們。
而不是“”你必須在該組件內移動它的aamin(app-animated-comp)。
BrowserAnimationsModule是您需要在app.module中添加的軟件包
https://material.angular.io/guide/getting-started
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
@NgModule({
...
imports: [BrowserAnimationsModule],
...
})
export class PizzaPartyAppModule { }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.