現在のビューに基づいてイベントを取得しようとしています。 'prev'、 'next'クリック、最初の表示ビューを追跡するために、私はCalendarOption viewRender
を使用して、完全なビューを返し、すべてのクリックを呼び出して、新しいフルビューを表示します。fullcalendar viewRender - サービス角度5を呼び出せません
問題は - viewRender
ビュー出力の抽出されたパラメータに基づいて、自分のイベントを取得しているサービスを呼び出すことができません。
constructor (public eventService: EventService)
calendarOptions = {
...
...
eventLimit: true,
viewRender: function(view) {
this.eventService.getEvents(view) // <--- code stops here, error printed at bottom
.subscribe(
response => {
this.events = response.events;
},
error => {
console.log(error)
}
);
console.log(this.events);
},
events: this.events,
...
...
}
私は仕事に私のサービスを期待していて、そのシナリオ内からトリガーされる - カレンダーに最初に初期化し、毎回「前に」/「次へ」ボタンが現在
をクリックされ、出力され
ERROR TypeError: Cannot read property 'getEvents' of undefined
この外部コマンドを呼び出す方法はありますか? 私はまた、直接のHttpClientを使用してみましたが、HTTPはまた、それが解決されるようになりました
あなたのEventServiceを表示 – brijmcq