我通过动画添加了一个动画
@Component({
....,
animations: [
trigger('slideIn', [
...
])
],
host: {
'[@animation]': 'condition'
}
}
Run Code Online (Sandbox Code Playgroud)
哪个运作良好,在编译时我被告知这已被弃用,我应该使用@HostBinding ......
@HostBinding('[@animation]') get slideIn() {
return condition;
}
Run Code Online (Sandbox Code Playgroud)
这让我错了
Can't bind to '[@animation' since it isn't a known property of 'my-component-selector'.
Run Code Online (Sandbox Code Playgroud)
但我无法在我的模块中添加动画..我该怎么办?