title: Reading data from JSON file in Angularjs
body: <p>Hai i am new in Angularjs. I am trying to read data from JSON file, But it returns a strange output. 
  Here is my controller.js file</p>
  
  <pre><code>angular
  .module('app')
  .controller('homeCtrl',function($scope,Friend){
        $scope.friends=Friend.get();
        console.log("DATA FROM JSON:",$scope.friends);
        $scope.title="Home";       
  
  })
  </code></pre>
  
  <p>Here is my services.js file </p>
  
  <pre><code>angular
  .module('app')
  .factory('Friend',function($http){
  
     return {
      get:function(){
  
              console.log("inside function");
              return [
  
  
              $http.get('/api/get.json').then(function(msg){
  
                  return msg.data;    
              })
             ]          
          }
     }
  })
  </code></pre>
  
  <p>console output is</p>
  
  <pre><code>DATA FROM JSON: 
  [Object]
  0: Object
  length: 1
  __proto__: Array[0
  </code></pre>
  
  <p>Please help.</p>