I want to set the content of HTML element with directive.
export class AdvertisementDirective {
constructor(el: ElementRef) {
el.nativeElement.style.background = 'yellow';
el.nativeElement.content = '<p>Hello World<p>';
}
}
But it does not work and doesn't give any error.
The idea behind doing this is to have Ad code in the directive and set it wherever I used directive attribute. The code for advertisement contains JavaScript
and HTML code.