title: ERROR TypeError: Cannot set property 'author' of undefined
body: <p>I get this error when i want to save changes to sever " add a comment" by clicking Submit button thanks for helping</p>
  
  <pre><code>onSubmit() {      
  this.comment.author = this.author;
  this.comment.rating = this.rating;
  this.comment.comment = this.comment1;
  
  
  this.comment.date = new Date().toISOString();
  console.log(this.comment);
  this.dishcopy.comments.push(this.comment);
  this.dishcopy.save()
    .subscribe(dish =&gt; { this.dish = dish; console.log(this.dish); });
  
    }
  </code></pre>
  
  <p>template code:</p>
  
  <pre><code>    &lt;div class="example-container"&gt;
    &lt;mat-form-field&gt;
      &lt;input matInput placeholder="author" [(ngModel)]="author"&gt;
    &lt;/mat-form-field&gt;
    &lt;mat-form-field&gt;
      &lt;mat-select placeholder="rating" [(ngModel)]='rating'&gt;
        &lt;mat-option value="1"&gt;1&lt;/mat-option&gt;
        &lt;mat-option value="2"&gt;2&lt;/mat-option&gt;
        &lt;mat-option value="3"&gt;3&lt;/mat-option&gt;
        &lt;mat-option value="4"&gt;4&lt;/mat-option&gt;
        &lt;mat-option value="5"&gt;5&lt;/mat-option&gt;
      &lt;/mat-select&gt;
    &lt;/mat-form-field&gt;
    &lt;mat-form-field&gt;
      &lt;textarea matInput placeholder="comment" [(ngModel)]="comment1"&gt;&lt;/textarea&gt;
    &lt;/mat-form-field&gt;
    &lt;button (click)="onSubmit()"&gt;Submit&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>More deteils:
  this is Comment.ts code:        </p>
  
  <pre><code>export class Comment {
  rating: number;
  comment: string;
  author: string;
  date: string;}
  </code></pre>
  
  <p>and I  instantiate it by:</p>
  
  <pre><code>import { Comment } from '../shared/comment';
  ...
  comment:Comment;
  </code></pre>