Мне на выходе дается такой массив (картинка ниже), как обратиться к элементам?
Через цикл for не получается...

UPD
export class SocialBlockComponent implements AfterViewInit, OnInit {
friends: FriendBirthdayPreview[] = [];
countBirthdays;
ngOnInit() {
if (this.authenticationService.isLoggedIn()) {
try {
this.loadBirthdays();
this.countNewBirthdays();
} catch (Error) {
console.log(Error.message);
}
}
}
loadBirthdays() {
this.friends = [];
this.friendService.getFriendsBirthdays(this.profileService.getProfileInfo().id).subscribe(
(response) => {
for (let i = 0; i < response.length; i++) {
response[i]['checkedBirthday'] = false;
const friend: FriendBirthdayPreview = new FriendBirthdayPreview;
Object.assign(friend, response[i]);
this.friends.push(friend);
}
}
);
}
countNewBirthdays() {
console.log(this.friends); // Выводит то, что показано в скриншоте
for (let i = 0; i < this.friends.length; i++) {
console.log(this.friends[i]); // Ничего не выводит
}
}
console.logкак можно было бы подумать. – Pavel Mayorov Sep 24 '18 at 10:22