title: Why should I use interfaces as data types in angular if there are classes allready?
body: <p>I recently watched tutorial of my teacher, and he show us this code:</p>
  
  <p><a href="https://i.stack.imgur.com/MA3Z9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MA3Z9.png" alt="enter image description here"></a></p>
  
  <p>And he also said <code>products</code> array which is type of <code>any []</code>  <strong>IS NOT USING BENEFITS OF STRONGLY TYPE</strong> which is feature of TypeScript so it should be defined as INTERFACE, but I'm wondering now, why he did not create a class and that products array might be of that class type?? </p>
  
  <p>He said Interfaces purpose is to provide strongly typing  and tooling support..
  So he wrote this interface:</p>
  
  <p><a href="https://i.stack.imgur.com/BMO69.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BMO69.png" alt="enter image description here"></a></p>
  
  <p>So I'm wondering why he did not create a class like :</p>
  
  <p><code>export class Product</code> .. and later he would use <code>products : Product []</code> .. </p>
  
  <p>So basically I can not figure out why is Interface as dataType better here instead of class?</p>
  
  <p>Sorry for screenshots and not real code, that's because he hosted online video lessons..</p>
  
  <p>Thanks</p>