// to create a model class, we first need to create a new file
//f.e person.ts
export class Person {
constructor(
public name: string,
public lastName: string,
public age:number
) {}
}
//now that we have the model class we can create arrays that contain Person class elements
.
.
public people: Person[];
constructor(){
this.people = [
new Person ('Carla','Smith', 20 ),
new Person ('Carlos','Smith', 25 ),
new Person ('Andrea','Johnson', 23 ),
];
}
//Define how single recipe should look like - Blueprint for object
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;
}
}