📜  输入上的角度主机绑定类 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:14.583000             🧑  作者: Mango

代码示例1
// Non objects
@HostBinding('class.active') @Input() active: boolean = false;

// With objects
@Input() something: obj;
@HostBinding('class.active')
get isActive(): boolean {
  return this.obj.isActive;
}