带* ngFor的角度动画

时间:2017-07-03 22:16:11

标签: angular animation

我有项目列表,我想一次触发一个项目的状态。 http://plnkr.co/edit/WGLbs2gl7zSxGymOSm0y?p=preview

点击时我只想点击项目以获取状态,如果状态为“已关闭”,则不应显示。

<md-card *ngFor="let item of items">
  <md-card-title (click)="showDetails()">{{item.name}}</md-card-title>
  <md-card-content [@state]="closed">state = {{state}}
    <p>{{item.hair_color}}</p>
    <p>{{item.skin_color}}</p>
    <p>{{item.eye_color}}</p>
  </md-card-content>
</md-card>
moment.updateLocale

1 个答案:

答案 0 :(得分:1)

或多或少通过传递项目并在项目上显示状态... http://plnkr.co/edit/QhArVlfFGIsXjx5QSLcX?p=preview

来计算出来
function euler(n) {
  let zero = new Decimal(0);
  let one = new Decimal(1);
  let rval;

  for (let i = 0; i <= n; i++) {
    let fval = factorial(i);
    let invert = one.dividedBy(fval)
    zero = zero.plus(invert)
  }
  rval = zero.toFixed(Number(n))
  return rval;
}

function factorial(n) {
  var i = 2,
    r = new Decimal(1);
  for (; i <= n; r = r.times(i++));
  return r;
}

希望它可以帮助别人:)