title: Creating model class through TS in angular 6
body: <p>I am trying to create a model class in my angular app which goes like this:</p>
  
  <pre><code>export class BookModel {
    public _id:any;
    public authors:any[];
    public categories:any[];
    public isbn:any;
    public longDescription:any;
    public pageCount:any;
    public thumbnailUrl:any;
    public title:any;
  
    constructor(id,author, category, isbn, longDescription, pageCount, thumbnailUrl, title) {
      this._id = id;
      this.authors.push(author);
      this.categories.push(category);
      this.isbn = isbn;
      this.longDescription = longDescription;
      this.pageCount = pageCount;
      this.thumbnailUrl = thumbnailUrl;
      this.title = title;
    }
  }
  </code></pre>
  
  <p>Now when i am instantiating this model class I am getting error that this.authors is undefined. 
  I am instantiating my class as </p>
  
  <pre><code>let newBook = new BookModel(formValues.id,formValues.AuthorName, formValues.category, formValues.isbn, formValues.description, formValues.pages, formValues.thumbnailUrl, formValues.bookName); 
  </code></pre>
  
  <p>But it gives me error:
  <a href="https://i.stack.imgur.com/ABC0n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ABC0n.png" alt="enter image description here"></a></p>