title: Angularjs displaying ajax response
body: <p>Basically my angular code looks like this    </p>
  
  <pre><code>    var myapp = angular.module("Demo",["ngRoute"])
              .config(function($routeProvider){
                  $routeProvider                                                      
                      .when("/students",{
                          templateUrl : "templates/students.html",
                          controller : "grouplistcontroller"
                      })
              })              
              .controller("grouplistcontroller", function($scope,$http){                      
                  $http.get("ajaxfunction.php?action=getlist")
                      .then(function(res) {   
                          var obj = JSON.stringify(res);
                          console.log(obj);
                          $scope.students = obj.data;
                      });                     
              });
  </code></pre>
  
  <p>The json data from server looks like this</p>
  
  <pre><code>"data":[
  {
  "sub_id":"1199",
  "sub_group":"GT"
  },
  {
  "sub_id":"727",
  "sub_group":"GT"
  },
  {
  "sub_id":"660",
  "sub_group":"GT"
  },
  {
  "sub_id":"614",
  "sub_group":"GT"
  }
  ],
  "status":200,
  "config":{
  "method":"GET",
  "transformRequest":[
  null
  ],
  "transformResponse":[
  null
  ],
  "url":"ajaxfunction.php?action=getlist",
  "headers":{
  "Accept":"application/json, text/plain, */*"
  }
  },
  "statusText":"OK"
  </code></pre>
  
  <p>I am trying to display the loop from the result in my front end, which isnt working</p>
  
  <pre><code>&lt;ul&gt;
     &lt;li ng-repeat="student in students"&gt;
          {{ student.sub_id }}
     &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>