pablocattaneo
6/6/2017 - 12:04 PM

Create a model

Create a model

export class Recipe {
  public name: string;
  public description: string;
  public imagePath: string;

  constructor(name: string, desc:string, imagePath: string){
    this.name = name;
    this.description = desc;
    this.imagePath = imagePath;
  }
}

// Name file: namefile.model.ts

// Typescript shortcut to create constructor

export class Recipe{
  constructor(public name: string, public desc:string, public imagePath: string){

  }
}