title: Binding issue with List of objects using AngularJS
body: <p>I have a simple create page which has list of label and date objects, rendered through data from rest api /restapi/reportTypes.
  On clicking the Save button I want to save all the data, by calling rest api /restapi/entity.
  But all the reportTypes objects are passed through the main object called entity.</p>
  
  <p><strong>Web page looks like this</strong></p>
  
  <p><a href="https://i.stack.imgur.com/ObxIk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ObxIk.png" alt="enter image description here"></a> </p>
  
  <p>Javascript</p>
  
  <pre><code>crudApp.controller('addController', function($scope, $http, $location) {
  
      $http.get("/restapi/reportTypes").success(function(data, status, headers, config) {
          $scope.reportTypes = data;
      });
  
      $scope.add = function() {
          $http.post("/restapi/entity", $scope.entity).success(function(data, status, headers, config, statusText) {
              $location.path('/list');    
          }).error(function(data, status, headers, config, statusText) {
              console.log("Error : " +statusText);
          });
      }
  }
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;div class="form-group" ng-repeat="reportType in reportTypes"&gt;
      &lt;label class="control-label col-md-3"&gt;{{reportType.label}}&lt;/label&gt;
  
      &lt;div class="input-group col-md-4"&gt;
          &lt;input id="startDate" type="text" class="form-control" ng-model="reportType.startDate"&gt; 
      &lt;/div&gt;
  &lt;/div&gt;
  
  
  &lt;div class="form-group"&gt;
      &lt;label class="control-label col-md-2"&gt;NOTES&lt;/label&gt;
      &lt;div class="col-md-7"&gt;
          &lt;input type="text" ng-model="entity.notes" class="form-control"&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;input type="submit" value="Add" ng-click="add()"&gt;
  </code></pre>
  
  <p>For that when I try with below code,</p>
  
  <pre><code>&lt;div class="form-group" ng-repeat="reportType in entity.reportTypes"&gt;
  </code></pre>
  
  <p>I get error </p>
  
  <pre><code>Error: $scope.entity is undefined
  </code></pre>
  
  <p><strong>Updated:</strong></p>
  
  <p>Here is my Entity class,</p>
  
  <pre><code>public class Entity {
  
      private List&lt;ReportType&gt; reportTypes;
  
      private String notes;
  
      // getter / setters
  }   
  </code></pre>