Answer the question
In order to leave comments, you need to log in
What's wrong I can't understand?
https://github.com/Felino7727/incode7727
export class AppComponent implements OnInit {
public fulls: FullModels[];
public data1: any;
constructor(private peopleService: PeopleService) {
}
ngOnInit() {
this.peopleService.getPeople().subscribe(data => {
this.data1 = data;
for (let i in this.data1) {
this.fulls[i] = [
new FullModel(
this.data1[i].general.firstName,
this.data1[i].general.lastName,
this.data1[i].general.avatar,
this.data1[i].job.company,
this.data1[i].job.title,
this.data1[i].contact.email,
this.data1[i].contact.phone,
this.data1[i].address.street,
this.data1[i].address.city,
this.data1[i].address.zipCode,
this.data1[i].address.country)
]
console.log(this.fulls[i])
}
});
}
}
export class FullModel {
constructor(
public firstName: string,
public lastName: string,
public avatar: string,
public company: string,
public title: string,
public email: string,
public phone: string,
public street: string,
public city: string,
public zipCode: string,
public country: string
) {
}
}
export interface FullModels {
fulls:FullModel[]
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question