动画内容儿童Angular(2/4)

时间:2017-08-14 22:10:06

标签: css angular

我有一个组件使用<ng-content>选择器来引入一些内容子项。

<!-- label-expand component-->
<div>
    <ng-content select="[appLabel]"></ng-content>
</div>

因此,当组件创建此标签扩展组件的实例时,如下所示:

<label-expand>
    <span appLabel>Some label</span>
</label-expand>

我想设置标签扩展组件,当盘旋时,用appLabel指令播放内容子项的动画,文本变大。

@Component({
    selector: 'label-expand',
    //...,
    animations: [trigger('expandLabelState', [
      //This is the animation I would like to pass to the content child
    ])]
})
export class LabelExpandComponent {
     @ContentChild(AppLabelDirective) appLabel: AppLabelDirective

}

如何将使用label-expand组件中的角度动画元数据定义的动画传递给它的ng-content内容子项?或者这是一个应该用CSS解决的问题吗?

0 个答案:

没有答案