title: Angular way to convert HTML-string to text string
body: <p>Currently I'm using</p>
  
  <pre><code>htmlToText(html: string) {
      const tmp = document.createElement('DIV');
      tmp.innerHTML = html;
      return tmp.textContent || tmp.innerText || '';
  }
  </code></pre>
  
  <p>for the task. What's the Angular way of doing that? Or is it perfectly fine to do like that? Can directly accessing <code>document</code> like that can lead to problems, e.g. with mobile apps?</p>
  
  <p>Note: There's an <a href="https://stackoverflow.com/questions/17289448/angularjs-to-output-plain-text-instead-of-html">AngularJS related question</a>, but I'm looking for an Angular2+ anwer. Plus I'm not sure whether the regex from that accepted answer is the way to go?</p>