title: Angular return html element
body: <p><strong>Hi there,</strong></p>
  
  <p>So I'm experimenting with AngularJS as a frontend framework and Wordpress as backend. I used a JSON wordpress plugin and load the content via $http request in Angular.</p>
  
  <p>The content is a string and I want to extract some images from it. I tried to do it like this:</p>
  
  <pre><code>BlogPost.prototype.images = function()
  {
      var element = document.createElement('div');
      element.innerHTML = this._data;
  
      var imgs = element.getElementsByTagName('img');
      var array = [].slice.call(imgs);
  
      return array;
  }
  </code></pre>
  
  <p>And my html:</p>
  
  <pre><code>&lt;div class="media"&gt;
      &lt;p class="img" ng-repeat="imgs in post.images()" ng-bind-html="imgs"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>It doesn't work the output on my the output on my html page is: <em>[object HTMLImageElement]</em> and in the console I get the following error: <a href="https://docs.angularjs.org/error/" rel="nofollow">https://docs.angularjs.org/error/</a>$rootScope/infdig (<em>Error: error:infdig Infinite $digestLoop</em>) Is there another way to get some html elements out of the string and return them back to my angular template?</p>
  
  <p><strong>Thanks in advance.</strong></p>