title: WP-json is not displaying with angularJS
body: <p>I want to display my posts of WordPress with the installed plugin WP-REST v2 to GET the data from trough AngularJS BUT theres a Problem. I can't display it and coded according to this article. </p>
  
  <p><a href="https://amielucha.com/angularjs-json-rest-api-with-wordpress" rel="nofollow noreferrer">https://amielucha.com/angularjs-json-rest-api-with-wordpress</a></p>
  
  <p>So my main topic is how to to this with angularjs.</p>
  
  <p>These are my codes:</p>
  
  <p>app.js:</p>
  
  <pre><code>(function() {
  var app = angular.module('app', ['ngRoute']),
      api = {};
  
  // JSON content Location
  api.query = 'http://myy.website/dlrz/wp-json/wp/v2/posts/';
  
  app.config([ '$routeProvider', '$locationProvider', '$qProvider', function($routeProvider, $locationProvider, $qProvider) {
      // Enable HTML5 Mode
      $locationProvider.html5Mode(true);
  
      // configure routing
      $routeProvider
          .when('/', {
          templateUrl: myLocal.partials + 'main.html',
          controller: 'Main'
      });
  
      $qProvider.errorOnUnhandledRejections(false);
  }]);
  
  // Set Controller and get JSON-Data
  app.controller('Main', [ '$scope', '$http', '$routeParams', '$sce', function($scope, $http, $routeParams, $sce) {
      $http.get(api.query).then(function(res){
          $scope.posts = res;
          // interate through each field to set it as trusted
          angular.forEach(res, function(value, key) {
              // trust each title and excerpt in the object
              this[key].title.rendered = $sce.trustAsHtml(value.title.rendered);
              this[key].excerpt.rendered = $sce.trustAsHtml(value.excerpt.rendered);
          }, $scope.posts);
          console.log($scope.posts);
          console.log($sce);
  
      });
  }]);
  })();
  </code></pre>
  
  <p>main.html:</p>
  
  <pre><code>&lt;section&gt;
  &lt;article class="well" ng-repeat="post in posts"&gt;
      &lt;header&gt;
          &lt;h1 ng-bind-html="post.title.rendered"&gt;
              {{post.title.rendered}}
          &lt;/h1&gt;
      &lt;/header&gt;
      &lt;div class="post-content" ng-bind-html="post.excerpt.rendered"&gt;
          {{post.excerpt.rendered}}
      &lt;/div&gt;
  &lt;/article&gt;
  </code></pre>
  
  <p></p>
  
  <p>index.php:</p>
  
  <pre><code>    &lt;?php /*get_header(); */?&gt;
  
  
  &lt;!DOCTYPE html&gt;
  &lt;html ng-app="app"&gt;
  
      &lt;head&gt;
          &lt;!-- Required meta tags always come first --&gt;
          &lt;meta charset="utf-8"&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"&gt;
          &lt;meta http-equiv="x-ua-compatible" content="ie=edge"&gt;
          &lt;base href="&lt;?php echo site_url();?&gt;/"&gt;
  
          &lt;title&gt;
              &lt;?php bloginfo( 'name'); ?&gt;
          &lt;/title&gt;
          &lt;?php wp_head(); ?&gt;
      &lt;/head&gt; 
      &lt;body&gt;   
          &lt;h1&gt;Hello World!&lt;/h1&gt;
  
          &lt;div ng-view&gt;&lt;/div&gt;
  
  
          &lt;footer&gt;
              &amp;copy; &lt;?php echo date( 'Y' ); ?&gt; Dart Liga Verband Zürich
          &lt;/footer&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;     
  &lt;?php wp_footer(); ?&gt;
  &lt;?php/* get_footer(); */?&gt;
  </code></pre>
  
  <p>this is the json file:
  <a href="http://myy.website/dlrz/wp-json/wp/v2/posts" rel="nofollow noreferrer">http://myy.website/dlrz/wp-json/wp/v2/posts</a></p>