title: Object creation using class vs interface in Typescript (Angular 5 ) vs Java and C#
body: <p>I want to understand using interface vs class to create model in angular 2. When we create model in Java or C#, we use model classes to represent data model that pass around in our application and therefore strongly typed.</p>
  
  <pre><code>//C#
  public class Movie 
  {
     public int ID { get; set; }
     public string Title { get; set; }
     public DateTime ReleaseDate { get; set; }
     public string Genre { get; set; }
     public decimal Price { get; set; }
  }
  </code></pre>
  
  <p>Most of the time we will stick to data binding with this kind of model to databases based on our requirements.</p>
  
  <p>I see examples and tutorials using same approaches like this.</p>
  
  <pre><code>//Java
  public class Movie
  {
     public int ID;
     public String Title;
     public Date ReleaseDate;
     public String Genre;
     public float Price;
  }
  </code></pre>
  
  <p>Then, I start using angular and typescript for web development. I find that some like to use interface to represent their model and other like to stick with class.</p>
  
  <pre><code>//Class
  export class Movie {
      public string id;
      public string title;
      public Date ReleaseDate;
      public string Genre;
      public number
  }
  //Interface
  export interface Movie {
      public string id;
      public string title;
      public Date ReleaseDate;
      public string Genre;
      public number
  }
  </code></pre>
  
  <p>However, when it comes to create and use model, it looks like same kind to me.</p>
  
  <pre><code> //declare
  let movie = new Movie();
  movie: Movie = new Movie();
  movies: Movie[];
  amovie: Movie;
  //reactive
  obsMovies: Observable&lt;Movie[]&gt;;
  obsAMovie: Observable&lt;Movie&gt;;
  </code></pre>
  
  <p>I want to know the difference if has any when use interface or class in typescript. My understanding of interface is simply contract for classes that shared functions whereas class can be anything that can imagine.</p>