title: How to access html elements of component tag?
body: <p>I want to access plain HTML declared in my component tag. Suppose I have component</p>
  
  <pre><code>@Component({
    selector: 'app-demo'
    template: '&lt;some_template&gt;&lt;/some_template&gt;'
  })
  export class AppDemoComponent {
  
  }
  </code></pre>
  
  <p>if I am defining <code>h1</code> inside the tag in another component</p>
  
  <pre><code>&lt;app-demo&gt;
    &lt;h1&gt; demo text &lt;/h1&gt;
  &lt;/app-demo&gt;
  </code></pre>
  
  <p>How can I access the h1 element inside the <code>AppDemoComponent</code>?</p>
  
  <p><strong>Edit:</strong>
  This question is not about ViewChild as ViewChild gets information from the current template of the component. I'm asking if the component tag is called in the different file and the tag has HTML elements then how to access it.</p>