title: How to instantiate model Angular 2
body: <p>I'm creating a very basic Angular 2 Application with the purpose of CRUD products. I have a CreateProductComponent but I'm having trouble instantiating the model that I wan't to use on my view. I'm getting this error:</p>
  
  <p><a href="https://i.stack.imgur.com/727c9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/727c9.png" alt="enter image description here"></a> </p>
  
  <p>This is my code:</p>
  
  <p>create-product.component.ts</p>
  
  <pre><code>import { Component, OnInit }  from '@angular/core';
  import { ROUTER_DIRECTIVES } from '@angular/router';
  
  import { Product } from '../product'
  import { ProductService } from '../product.service'
  
  @Component({
      moduleId: module.id,
      selector: 'app-create-product',
      templateUrl: 'create-product.html',
      styleUrls: ['create-product.css'],
  })
  export class CreateProductComponent {
  
      model: new Product(1,'2',1); &lt;- error on this line
  
      constructor(private productService: ProductService) { }
  
      addProduct() {        
  
          //this.productService.addProduct(this.product);
      }
  }
  </code></pre>
  
  <p>product.ts</p>
  
  <pre><code>export class Product {
  
      constructor(
          public ID: number,
          public Name: string,
          public Price: number
      ) { }   
  }
  </code></pre>
  
  <p>Ideally, I would like to create an empty product, or a product with defaul values so that when a form in the view is filled with the product data this data is passed down to the product. Does anyone know how to solve this?</p>