title: Why do I get an error in angular if the return of the api is correct?
body: <p>I make a API call to Wordpress with Angular:</p>
  
  <pre><code>angular.module('assetApp.services',[])
      .factory('Asset', function($resource, $cacheFactory) {
          var assetsCache = $cacheFactory('Assets');
          var res = $resource('/wp-json/wp/v2/assets?&amp;tags=:tags&amp;posts_per_page=40&amp;page=:page', {
              'get': { method:'GET', cache: assetsCache, isArray:true },
              'query': { method:'GET', params:{}, cache: assetsCache, isArray:true }
          });
          return res;
      }).factory('Category', function($resource) {
          return $resource('/wp-json/wp/v2/asset_category/', {
              'get': { method:'GET' },
          });
      });
  </code></pre>
  
  <p>an become in the console the follow error:</p>
  
  <pre><code>angular.min.js?ver=1539242296:2920 SyntaxError: Unexpected token &lt; in JSON at position 0
      at JSON.parse (&lt;anonymous&gt;)
  </code></pre>
  
  <p>If i test the API with a Rest API tool it returns a valid JSON.</p>