calendar.html
<full-calendar
defaultView="dayGridMonth"
[plugins]="calendarPlugins"
[weekends]="true"
[events]="[
{ title: 'event 1', date: '2019-06-07' },
{ title: 'event 2', date: '2019-06-12' }
]"
></full-calendar>
and this how look
everything is fine but ı want load event from json instead of “[events]” array and ı made service
schedule.ts
export class ScheduleProvider {
constructor(public http: HttpClient) {
console.log('Hello ScheduleProvider Provider');
}
getData():Observable<any[]>{
return this.http.get<any[]>('url/events');
}
}
this my json url/events
{“data”:[{“id”:1,“name”:"subject 1"“start_time”:“2019-07-21 00:00:00”},{“id”:2,“name”:"subject 2"“start_time”:“2019-07-28 00:00:00”},{“id”:3,“name”:"subject 3"“start_time”:“2019-07-30 00:00:00”}]}
calendar.ts
jsonEvents:any=[];
ngOnInit(){
this.svc.getData().subscribe(data=>this.jsonEvents=data);
}
ı dont know how to display jsonEvents in calendar instead of events array . So please help me.