Answers for "create CSS class in directive angular"

0

create CSS class in directive angular

@Directive({
    selector: '[myHighlight]',
})
class MyDirective {
  @HostBinding('style.background-color')
  backgroundColor:string = 'yellow';
}
Posted by: Guest on May-06-2022
0

create CSS class in directive angular

@Directive({
    selector: '[myHighlight]',
    host: {
      '[style.background-color]': '"yellow"',
    }
})
Posted by: Guest on May-06-2022

Browse Popular Code Answers by Language