1// to create a model class, we first need to create a new file
2//f.e person.ts
3
4export class Person {
5 constructor(
6 public name: string,
7 public lastName: string,
8 public age:number
9
10 ) {}
11}
12
13//now that we have the model class we can create arrays that contain Person class elements
14
15.
16.
17public people: Person[];
18constructor(){
19 this.people = [
20 new Person ('Carla','Smith', 20 ),
21 new Person ('Carlos','Smith', 25 ),
22 new Person ('Andrea','Johnson', 23 ),
23
24 ];
25}
26
27
28