title: error when pushing new element to array in javascript
body: <p>I am trying to add comments from html form elements to array in angularjs. When I use javascipt push function I got an error "property of object doesn't exist". 
  Can someone help me to solve this issue. Below you can find my javascript and html code: </p>
  
  <p>Thank you for reading</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    .controller('DishDetailController', ['$scope', function($scope) {
  
              var dish={
                            name:'Uthapizza',
                            image: 'images/uthapizza.png',
                            category: 'mains', 
                            label:'Hot',
                            price:'4.99',
                            description:'A unique combination of Indian Uthappam (pancake) and Italian pizza, topped with Cerignola olives, ripe vine cherry tomatoes, Vidalia onion, Guntur chillies and Buffalo Paneer.',
                             comments: [
                                 {
                                     rating:5,
                                     comment:"Imagine all the eatables, living in conFusion!",
                                     author:"John Lemon",
                                     date:"2012-10-16T17:57:28.556094Z"
                                 },
                                 {
                                     rating:4,
                                     comment:"Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
                                     author:"Paul McVites",
                                     date:"2014-09-05T17:57:28.556094Z"
                                 },
                                 {
                                     rating:3,
                                     comment:"Eat it, just eat it!",
                                     author:"Michael Jaikishan",
                                     date:"2015-02-13T17:57:28.556094Z"
                                 },
                                 {
                                     rating:4,
                                     comment:"Ultimate, Reaching for the stars!",
                                     author:"Ringo Starry",
                                     date:"2013-12-02T17:57:28.556094Z"
                                 },
                                 {
                                     rating:2,
                                     comment:"It's your birthday, we're gonna party!",
                                     author:"25 Cent",
                                     date:"2011-12-02T17:57:28.556094Z"
                                 }
                                 
                             ]
                      };
              
              $scope.dish = dish;
              
          }])
  
          .controller('DishCommentController', ['$scope', function($scope) {
  
  
              $scope.newcomment = {
                  rating : "",
                  comment: "",
                  author: "",
                  date: new Date().toISOString()
          };
              $scope.submitComment = function () {
                  
                  //Step 2: This is how you record the date
  
  
                  $scope.dish.comments.push($scope.newcomment);
                  
                
              }
          }])
  
  ;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en" ng-app="confusionApp"&gt;
  
  &lt;head&gt;
       &lt;meta charset="utf-8"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
    
         &lt;link href="../bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"&gt;
      &lt;link href="../bower_components/bootstrap/dist/css/bootstrap-theme.min.css" rel="stylesheet"&gt;
      &lt;link href="../bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet"&gt;
      &lt;link href="styles/bootstrap-social.css" rel="stylesheet"&gt;
      &lt;link href="styles/mystyles.css" rel="stylesheet"&gt;
  &lt;!-- endbuild --&gt;
  
     
        &lt;script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"&gt;&lt;/script&gt;
        &lt;script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"&gt;&lt;/script&gt;
      &lt;![endif]--&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
      &lt;div class="container"&gt;
          &lt;div class="row row-content" ng-controller="DishDetailController"&gt;
              &lt;div class="media" ng-model="dish"&gt;
                  &lt;div class="media-left media-middle"&gt;
                      &lt;a href="#"&gt;
                          &lt;img class="media-object img-thumbnail" ng-src={{dish.image}} alt="Uthapizza"&gt;
                      &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="media-body"&gt;
                      &lt;h2 class="media-heading"&gt; {{dish.name}}
                          &lt;span class="label label-danger"&gt;
              {{dish.label}}
          &lt;/span&gt;
                          &lt;span class="badge"&gt;
              {{dish.price | currency}}
          &lt;/span&gt;
                      &lt;/h2&gt;
                      &lt;p&gt;{{dish.description}}&lt;/p&gt;
                  &lt;/div&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;br&gt;
          &lt;br&gt;
          &lt;br&gt;
  
          &lt;div class="col-xs-9 col-xs-offset-1" ng-controller="DishDetailController"&gt;
              &lt;h4&gt;Customer Comments&lt;/h4&gt; Sort by:
              &lt;input type="text" ng-model="filterText"&gt;
              &lt;blockquote ng-repeat="commentla in dish.comments | orderBy: filterText"&gt;
                  &lt;p class="mb-0"&gt;  {{commentla.rating}} Stars &lt;/p&gt;
                  &lt;p class="mb-0"&gt;{{commentla.comment}}&lt;/p&gt;
                  &lt;footer class="blockquote-footer"&gt; {{commentla.author}} {{commentla.date | date: 'mediumDate'}} &lt;/footer&gt;
              &lt;/blockquote&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
              &lt;div class="col-xs-9 col-xs-offset-1" ng-controller="DishCommentController"&gt;
                      &lt;ul class="list-unstyled"&gt;
                     Your Name: {{newcomment.author}}
                          &lt;br&gt;
                          Comment:  {{newcomment.comment}}
                          &lt;br&gt;
                          Your Rating: {{newcomment.rating}}
  
  
       &lt;!-- &lt;p&gt;Task 3: Here you include the code to show the live preview of the comment&lt;/p&gt;
        &lt;p&gt;The comment should be shown only when the form contains valid
        information and is not pristine&lt;/p&gt; --&gt;
                      &lt;/ul&gt;
                  &lt;form class="form-horizontal" name="commentForm" ng-submit="submitComment()" novalidate&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label for="yname" class="col-sm-2 control-label"&gt;Your Name:&lt;/label&gt;
                          &lt;div class="col-sm-10"&gt;
                          &lt;input type="text" class="form-control" id="yname" aria-des                &lt;div class="col-sm-10"&gt;
                          &lt;label class="radio-inline"&gt;
                              &lt;input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="1" ng-model="newcomment.rating"&gt; 1
                          &lt;/label&gt;
                          &lt;label class="radio-inline"&gt;
                              &lt;input type="radio" name="inlineRadioOptions" id="inlineRadio2" value="2" ng-model="newcomment.rating"&gt; 2
                          &lt;/label&gt;
                          &lt;label class="radio-inline"&gt;
                              &lt;input type="radio" name="inlineRadioOptions" id="inlineRadio3" value="3" ng-model="newcomment.rating"&gt; 3
                          &lt;/label&gt;
                          &lt;label class="radio-inline"&gt;
                              &lt;input type="radio" name="inlineRadioOptions" id="inlineRadio4" value="4" ng-model="newcomment.rating"&gt; 4
                          &lt;/label&gt;
                          &lt;label class="radio-inline"&gt;
                              &lt;input type="radio" name="inlineRadioOptions" id="inlineRadio5" value="5" ng-model="newcomment.rating"&gt; 5
                          &lt;/label&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label for="commentm" class="col-sm-2 control-label"&gt;Your Comment&lt;/label&gt;
                          &lt;div class="col-sm-10"&gt;
                              &lt;textarea class="form-control" id="commentm" name="commentm" rows="12" ng-model="newcomment.comment"&gt;&lt;/textarea&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="form-group"&gt;
                          &lt;div class="col-sm-offset-2 col-sm-10"&gt;
                              &lt;button type="submit" class="btn btn-primary" ng-disabled="feedbackForm.$invalid"&gt;Submit Comment&lt;/button&gt;
                          &lt;/div&gt;
                        
                      &lt;/div&gt;
                  &lt;/form&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;!-- build:js scripts/main.js --&gt;
      &lt;script src="../bower_components/angular/angular.min.js"&gt;&lt;/script&gt;
      &lt;script src="scripts/app.js"&gt;&lt;/script&gt;
  &lt;!-- endbuild --&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>