Restangular.all('events').getList().then(function(event) {
$scope.events = event;
});
$scope.calConfig = {
views: [
{"type": "agenda", "label": "Agenda"},
{"type": "agendaDay", "label": "Day"},
{"type": "agendaWeek", "label": "Week"},
{"type": "month", "label": "Month"},
],
view: "agendaWeek",
eventSources: [$scope.events],
now: moment().toDate(),
/*/Callback Methods */
},
Restangular を使用して MongoDB からデータを取得し、そのデータを fullcalendar に使用しようとしています。問題は、Restangular ブロックを使用しているときに $scope.events が未定義であることです。
$scope.calConfig にどのように使用できますか?