How to use @HostBinding with @Input properties in Angular 2?

前端 未结 5 1627
青春惊慌失措
青春惊慌失措 2020-12-29 20:27

(Angular 2 RC4)

With @HostBinding we should be able to modify properties of the host, right? My question is, does this apply to @Input() properties as well and if so

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-29 20:47

    You need to combine the decorators like this:

    @HostBinding('class.active') @Input() active: boolean = false;

提交回复
热议问题