title: Unable to display received data
body: <p>Hi I am new to angular and spring. I am trying to create a small example where i receive a user data from server and display it on webpage. I have successfully established connection but I am unable to print received data. Attached is the code.</p>
  
  <p>Webpage code: </p>
  
  <pre><code>&lt;body&gt;
      &lt;div ng-app="MyApp" ng-controller="MyCtrl"&gt;
          &lt;table&gt;
              &lt;tr ng-repeat="user in data"&gt;
                  &lt;td&gt;{{user.name}}&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
       &lt;/div&gt;
  
      &lt;script&gt;
          var app=angular.module("MyApp",[]);
          app.controller("MyCtrl",function($scope,$http){
              $scope.data=[];
              $http.get("/loginUser").then(function(response){
                  $scope.data=response
              },function(){
  
              })
          });
      &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Controller code:</p>
  
  <pre><code>@Controller
  public class MainController {
  
  @RequestMapping(value="/loginUser",method=RequestMethod.GET)
  public ResponseEntity&lt;List&lt;User&gt;&gt; getLoginInfo(){
      String loginInfo="Controller hit";
      System.out.println(loginInfo);
      List&lt;User&gt; users=new ArrayList&lt;User&gt;();
      users.add(new User("Jayant"));
      System.out.println(users.size());
      return new ResponseEntity&lt;List&lt;User&gt;&gt;(users, HttpStatus.OK);
   }
  }
  </code></pre>
  
  <p>User Class:</p>
  
  <pre><code>public class User {
  
  private String name;
  
  public User(String name) {
      this.name = name;
  }
  
  public String getName() {
      return name;
  }
  
  public void setName(String name) {
      this.name = name;
  }
  
  }
  </code></pre>