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中获取数据,然后将这些数据用于全日历。问题是 $scope.events 在使用 restangular 块时未定义。
如何将它用于 $scope.calConfig?