title: How to set HTML content in the ElementRef (nativeEelement)?
body: <p>I want to set the content of HTML element with directive.</p>
  
  <pre><code>export class AdvertisementDirective {
  
    constructor(el: ElementRef) {
      el.nativeElement.style.background = 'yellow';
      el.nativeElement.content = '&lt;p&gt;Hello World&lt;p&gt;';
    }
  
  }
  </code></pre>
  
  <p>But it does not work and doesn't give any error. </p>
  
  <p>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 <code>JavaScript</code> and HTML code.</p>