JSON
{ success: true, data {...}, calendar {...}
Компонент
import { Component, OnInit } from '@angular/core';
import {MonthlyViewService} from "../../../monthlyView.service";
import 'rxjs/add/operator/map';
@Component({
selector: 'app-calendar',
templateUrl: './calendar.component.html',
styleUrls: ['./calendar.component.css']
})
export class CalendarComponent implements OnInit {
constructor(private monthlyViewService: MonthlyViewService) {}
ngOnInit() {
this.monthlyViewService.getMonthlyData().subscribe(res => {
let data = res.map(res => res.data);
console.log(data);
})
}
}
В приведенном выше коде я хочу получить доступ к данным, данным календаря из ответа и сохранить их в другоммассив.Я получаю сообщение об ошибке на карте - карта не существует для объекта типа.Любое решение