7
Angular 2 TypeScript cách tìm phần tử trong Array
Tôi có Thành phần và Dịch vụ: Thành phần: export class WebUserProfileViewComponent { persons: Person []; personId: number; constructor( params: RouteParams, private personService: PersonService) { this.personId = params.get('id'); this.persons = this. personService.getPersons(); console.log(this.personId); } } Chạy đoạn mãẨn kết quảMở rộng đoạn trích Dịch vụ: @Injectable() export class PersonService { …