title: angular to fetch the json service from http
body: <p>I have my js for angular to fetch the json service from http and am using the {{post.title}} on my html to get the data and post to my html. </p>
  
  <p>The data is not showing up on html page - using code pen.</p>
  
  <pre><code>var app = angular.module("blogApp", []); 
  app.controller("mainCtrl",      function($scope) {
  $scope.posts = []; 
  let postsUrl ="https://jsonplaceholder.typicode.com/posts"
      getPosts().then(posts =&gt;{
          $scope.posts = posts.slice(3);
          $scope.$apply();
      });
  
      function getPosts(){
          return fetch(postsUrl).then(res=&gt;res.json());
      }
  </code></pre>
  
  <p>});</p>