[英]How to enable Angular animations?
I've done everything by the tutorial ( https://angular.io/guide/animations ), but I have the error: menu-navigation.component.html:1 ERROR Error: Found the synthetic property @slideTop. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.
我已经通过教程( 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.
I read everything about it but did not find the answer on how to resolve it. 我阅读了有关它的一切,但没有找到解决方法的答案。
Files: 文件:
So I did: 所以我做了:
I tried: 我试过了:
Guys, help me :) I am stuck for already a few days. 伙计们,帮帮我:)我已经被困了几天了。
UPDATE: Finally, I found the answer after testing on a new empty project 更新: 最后,我在测试一个新的空项目后找到了答案
If you defined "animations" to the component (prop), then you can use them only inside its component (its own html), but not within a parent layout. 如果您为组件(prop)定义了“动画”,那么您只能在其组件(它自己的html)中使用它们,但不能在父布局中使用它们。
Instead of "" you must move its amination inside that component (app-animated-comp). 而不是“”你必须在该组件内移动它的aamin(app-animated-comp)。
BrowserAnimationsModule is an package you need to add in your app.module BrowserAnimationsModule是您需要在app.module中添加的软件包
https://material.angular.io/guide/getting-started 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.