Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

angular host binding class on input

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

// With objects
@Input() something: obj;
@HostBinding('class.active')
get isActive(): boolean {
  return this.obj.isActive;
}
 
PREVIOUS NEXT
Tagged: #angular #host #binding #class #input
ADD COMMENT
Topic
Name
5+4 =