首页 新闻 会员 周边 捐助

升级至 angular 19 后报错:"NG05105: Unexpected synthetic property @tabSwitchMotion found"

0
悬赏园豆:30 [已解决问题] 解决于 2025-01-03 08:27

升级至 angular 19 并且迁移至 standalone components 后运行时报错

main.ts:6 RuntimeError: NG05105: Unexpected synthetic property @tabSwitchMotion found. Please make sure that:
  - Either `BrowserAnimationsModule` or `NoopAnimationsModule` are imported in your application.
  - There is corresponding configuration for the animation named `@tabSwitchMotion` defined in the `animations` field of the `@Component` decorator (see https://angular.io/api/core/Component#animations).
dudu的主页 dudu | 高人七级 | 园豆:28541
提问于:2025-01-03 08:18
< >
分享
最佳答案
0

需要在 app.config.ts 中添加 provideAnimations

providers: [
    provideAnimations(),
]
dudu | 高人七级 |园豆:28541 | 2025-01-03 08:26
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册