title: How to create a popover component in angular?
body: <p>I want to create a <code>popover</code> component which will have api like below:</p>
  
  <pre><code>&lt;button  popover [content]="popover_content" &gt;popover test&lt;/button&gt;
  
  &lt;ng-template #popover_content&gt;
    &lt;ul&gt;
      &lt;li&gt;1&lt;/li&gt;
      &lt;li&gt;2&lt;/li&gt;
      &lt;li&gt;3&lt;/li&gt;
      &lt;li&gt;4&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/ng-template&gt;
  </code></pre>
  
  <p>I have tried to some extent, pls see <a href="https://stackblitz.com/edit/angular-bj2ke4?file=src%2Fapp%2Fhello.component.ts" rel="nofollow noreferrer">stackblitz</a></p>
  
  <p>The problem is:</p>
  
  <ol>
  <li>Content is appearing inside the button. How do I avoid it?</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/eBtPA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eBtPA.png" alt="enter image description here"></a></p>
  
  <ol start="2">
  <li>I want the content to give it some css class but when I access it I just get a comment node.</li>
  </ol>
  
  <pre><code>      @Input() set content(val: TemplateRef&lt;void&gt;) {
          this.popoverContent = val;
          console.log(val.elementRef.nativeElement);//this is a comment node. WHY??
        }
  </code></pre>
  
  <p>I am not sure how to solve above two problems. Would be great if someone could advice.</p>