title: how to set base64 url to image src
body: <p>Actually, I have an image using <code>angular-cli</code>:</p>
  
  <pre><code>&lt;img src="" style="width: 120px; padding-top: 10px" alt="" id="dishPhoto"&gt;
  </code></pre>
  
  <p>and Base64 image url <em>imgUrl</em>. So I would like to set img src:</p>
  
  <pre><code>let img = document.getElementById('dishPhoto');
  img.setAttribute('src',this.imgUrl);
  </code></pre>
  
  <p>but I get an error:</p>
  
  <blockquote>
    <p>document.getElementById(...) is null</p>
  </blockquote>
  
  <p>Could you please help me to fix it?</p>