【问题标题】:What's the minimum Angular Rc.X version to use animate?使用 animate 的最低 Angular Rc.X 版本是多少?
【发布时间】:2017-01-17 08:13:27
【问题描述】:

使用 Angular 2 动画的最低 Angular 2 RC 版本是多少?

我有一个

https://angular.io/docs/ts/latest/guide/animations.html

import {
  Component,
  Input,
  trigger,
  state,
  style,
  transition,
  animate
} from '@angular/core';

我一直在尝试在 Angular 2 RC.4 中使用 state,但出现以下错误:

Error: Uncaught (in promise): Template parse errors:
Can't bind to '@teamState' since it isn't a known native property

    <img [@teamState]="state1" src="image_url">
<img [@teamState]="state2" src="image2_url">
<img [@teamState]="state3" src="image3_url">

【问题讨论】:

  • 你能说明你在哪里以及如何使用@teamState吗?还要告诉您使用的是哪个版本的 angular2?现在是rc4 吗?
  • 如果您使用的是 RC4,那很好。我怀疑你在实施中应该有一些问题。

标签: angular


【解决方案1】:

问题在于 [@teamState]="..."

RC4 中,应该是 @teamState="..."

对于 RC5更高版本,它应该是 [@teamState]="..."

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-03-17
    • 1970-01-01
    • 1970-01-01
    • 2021-04-26
    • 1970-01-01
    • 1970-01-01
    • 2022-11-10
    相关资源
    最近更新 更多