我正在尝试在我的项目中使用calendar.ui。我可以在视图上使用ng-model来带我的事件,但不能从Rest Services的营业时间带入日历。这是我的观点:
<div class="calendar" ng-if="events.length && businessHours.length" ui-calendar="uiConfig.calendar" ng-model="events"></div>
这是我的js:
$scope.uiConfig = {
calendar:{
header: {
left: 'prev,next today',
center: 'title',
right: 'agendaDay,agendaWeek,month,list'
},
nowIndicator: 'true',
defaultView: 'agendaWeek',
locale: 'es',
navLinks: true,
selectable: true,
selectHelper: true,
selectOverlap: false,
allDaySlot: false,
businessHours: $scope.businessHours,
selectConstraint: "businessHours",
editable: false,
eventOverlap: false,
eventClick: $scope.eventClick,
}
};
这是我对同一js的rest服务的呼叫
post(url,data,$http,function(response) {
$scope.events = [response['events']];
$scope.businessHours = response['businessHours'];
});
这是该休息服务调用($ scope.businessHours)的输出:
[{"dow":"[1]","start":"08:00:00","end":"23:59:00"},{"dow":"[2]","start":"08:00:00","end":"23:59:00"},{"dow":"[3]","start":"08:00:00","end":"23:59:00"},{"dow":"[4]","start":"08:00:00","end":"23:59:00"},{"dow":"[5]","start":"08:00:00","end":"23:59:00"},{"dow":"[6]","start":"09:00:00","end":"23:59:00"}]
有人可以帮我吗?