我想从 html 传递组件动画的延迟,例如:
html:
<circles[delay]="'10000ms'"></circles>
ts:
@Component({
selector: 'circles',
templateUrl: 'app/landing-page/subcomponents/circles.component.html',
styleUrls: ['app/landing-page/subcomponents/circles.component.css'],
animations: [
trigger('flyIn', [
state('in', style({ transform: 'translateY(0)', opacity: 1 })),
transition('void => *', [
style({ transform: 'translateY(-100%)', opacity: 0 }),
animate("1000ms" + this.delay)
])
])
]
})
export class CirclesComponent {
@Input() private delay: string;
但是,当我这样做时,会出现此错误:
(SystemJS)无法读取未定义的属性“延迟”(...)
如何在不导致此错误的情况下将延迟传递给 html 中的组件?