【发布时间】:2013-12-03 16:31:17
【问题描述】:
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?
【问题讨论】:
标签: javascript mongodb angularjs fullcalendar restangular