title: How to Get Array from $http and view it with ng-repeat
body: <p>i want to get an array of JSON objects from a return function ,and loop inside this array using ng-repeat , but its not working for me , this is my code : </p>
  
  <pre><code>var app=angular.module("myApp",[]);
  
  app.controller("myController",function($scope,$http){
  
      $scope.listOfFields=[];
  
   $scope.getlistOfFieldsByIdTable = function(idTable)
      {
         $http.get("/listOfFieldsByIdTable/"+idTable)
         .success(function(data){
  
           return data;
  
         });
      };
  
  });
  
  &lt;!-- first call  --&gt;
  &lt;!-- 150 is the id of the table--&gt;
  &lt;div class="panel-body" ng-app="myApp" ng-controller="myController"&gt;
  
      &lt;ul ng-init="listOfFields = getlistOfFieldsByIdTable(150)"&gt; 
          &lt;li ng-repeat="field in listOfFields "&gt;
                  {{field.name}}
          &lt;/li&gt;
     &lt;/ul&gt;                           
  &lt;/div&gt;
  
  &lt;!-- second call  --&gt;
  
   &lt;div class="panel-body" ng-app="myApp" ng-controller="myController"&gt;
      &lt;ul&gt;
          &lt;lib ng-repeat="field in getlistOfFieldsByIdTable(150)"&gt;
                        {{field.name}}
          &lt;/li&gt;
     &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>the two calls that i used are not working for me, my service works fine when i used a RestClient like "Advanced Rest Client plugin in Google Chrome"
  can you help me how to call properly my array of objects, and show the results in my HTML page,
  thanks in advanced.</p>