0
私はui-calendarを使用しています。私はカレンダーに表示するために私のすべてのイベントを取得するためにサーバーを呼び出す必要があります。
ここ は、私が何をすべきかです:Angularjs - ui-calendar:イベントをリフレッシュする方法
コントローラー:
vm.propositionsToCome = PropositionsAffairePresentationToCome.get(function(result){
for(var i = 0; i < result.length; i++)
{
$scope.events.push({title: 'test'+i,start: result[i].datePresentationPartenaire});
}
$scope.eventSources = [$scope.events]
uiCalendarConfig.calendars['myCalendar'].fullCalendar('refreshEvents');
});
$scope.uiConfig = {
calendar:{
height: 450,
editable: true,
header:{
left: 'title',
center: '',
right: 'today prev,next'
},
lang: 'fr'
}
};
$scope.eventSources = [$scope.events];
HTML:
:div class="calendar" ng-model="events" calendar="myCalendar" config="uiConfig.calendar" ui-calendar="uiConfig.calendar"></div>
eventSourcesはよく、私はビューで表示するとき、私は取得しています、満たされています
[「タイトル」:「テスト0」、「開始」:「2016-06-20T22:00:00.000Z」、「_ id」:1}、{「タイトル」:「テスト1」、「開始」: "2016- 06-20T22:00:00.000Z "、" _ id ":2}]]
ただし、予定表には何も表示されません。サーバーからすべての自分のイベントを読み込んだら、カレンダーをリフレッシュする方法がわかりません。
どうすればいいですか?
、このコードが動作しません –