【发布时间】:2014-12-25 11:41:01
【问题描述】:
我正在尝试配置 angular-ui 日历,但运行时出现错误。
TypeError: undefined is not a function
at Object.eventsWatcher.onChanged (http://localhost/fisioGest/js/calendar.js:262:41)
我可以看到事件,一切似乎都正常,但是这个错误,我无法点击事件。
这是我的 app.js 的日历控制器:
app.controller('main-controller',function($scope){
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
this.tab=1;
this.titulopagina='Escritorio';
this.selectTab=function(setTab) {
this.tab=setTab;
};
this.isSelected=function(checkTab) {
return this.tab===checkTab;
};
$scope.eventSources = [
[
{
"title": 'All Day Event',
"start": new Date(y, m, d)
},
{
"title": 'Long Event',
"start": new Date(y, m, d - 5),
"end": new Date(y, m, d - 2)
}
]
];
$scope.calendarOptions = {
calendar: {
height: 500,
editable: true,
header: {
left: 'title',
center: '',
right: 'prev,next basicWeek month agendaDay'
},
}
};
});
这就是我定义我的日历的方式:
<div id="calendar" ui-calendar="calendarOptions.calendar" ng-model="eventSources " class="p-relative p-10 m-b-20"></div>
【问题讨论】:
标签: javascript jquery angularjs fullcalendar angular-ui