I try to put a calendar to my project with angular ui-calendar. Scope works, I can see the message on my page but calendar does not. Here is my code:
$scope.uiConfig = {
message : "heyyyy",
calendar:{
height: 450,
editable: true,
header:{
left: 'month basicWeek basicDay agendaWeek agendaDay',
center: 'title',
right: 'today prev,next'
},
eventClick: $scope.alertEventOnClick,
eventDrop: $scope.alertOnDrop,
eventResize: $scope.alertOnResize,
eventRender: $scope.eventRender
}
But I have an error like:
calendar.fullCalendar is not a function
here is the calendar.js code that occurs that error:
scope.initCalendar = function(){
if (!calendar) {
calendar = angular.element(elm).html('');
}
calendar.fullCalendar(options);
if(attrs.calendar) {
uiCalendarConfig.calendars[attrs.calendar] = calendar;
}
};
I tried this solution: Angular UI-Calendar TypeError: calendar.fullCalendar is not a function
But this gave an error to:
$ is not defined
I don't know why ui-calendar is broken like this. There is no useful solution here. So pls help thanks