title: Can not set property InnerHTML of Null on my Ionic Application?
body: <p>In the code I am trying to show remaining time to generate a random code in the DOM.</p>
  
  <pre><code>   var count = setInterval(function () {
                      var date = new Date();
                      var currentSecond = date.getSeconds();
                      this.remaining = 60 - currentSecond;
                      document.getElementById("timer").innerHTML = this.remaining;
                      // alert('Time is running out ' + (i++));
                      temp.data.loadAll().then(result =&gt; {
                          temp.accounts = result;
                      });
                  }, 1000);
  </code></pre>
  
  <p>And I am getting following error</p>
  
  <blockquote>
    <p>ERROR TypeError: Cannot set property innerHTML of null</p>
  </blockquote>