I'm trying to configure the angular-ui calendar but I have an error when I run it.
TypeError: undefined is not a function
at Object.eventsWatcher.onChanged (http://localhost/fisioGest/js/calendar.js:262:41)
I can see the events and everything seems to work right but this error and I can't click on the events.
This the calendar controller of my 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'
},
}
};
});
And this how I define my calendar:
<div id="calendar" ui-calendar="calendarOptions.calendar" ng-model="eventSources " class="p-relative p-10 m-b-20"></div>