title: Hide elements using Typescript
body: <p>I'm new to Typescript and Angular Material. I want to hide elements inside elements like this.</p>
  
  <pre><code>&lt;div id="abc"&gt;
     &lt;div id="123"&gt;
        &lt;p&gt;Hello!&lt;/p&gt;
     &lt;/div&gt;
        &lt;p&gt;World&lt;/p&gt;
  &lt;/div&gt;
  &lt;div id="def"&gt;
      &lt;p&gt;Hello World&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I want to hide div block(id:123).I tried in this way.</p>
  
  <pre><code>var formElement = &lt;HTMLFormElement&gt;document.getElementById('123');
  formElement.style.display='block';
  </code></pre>
  
  <p>It gets an error saying <strong>Cannot read property 'style' of null....</strong> How can I solve this problem.</p>