Angular - Directives
Given this directive that changes background color:
What will be the background color of this element?
@Directive({selector: '[appBgColor]'})
export class BgColorDirective {
constructor(el: ElementRef) {
el.nativeElement.style.backgroundColor = 'yellow';
}
}What will be the background color of this element?
<div appBgColor>Hello</div>
