angular-ui / ui-calendar

A complete AngularJS directive for the Arshaw FullCalendar.
http://angular-ui.github.io/ui-calendar/
MIT License
1.49k stars 729 forks source link

Not able to load ui calendar getting error as calendar.fullCalendar is not a function #523

Closed Sujay-shetty closed 6 years ago

Sujay-shetty commented 6 years ago

Hi,

I'm trying to use ui-calendar load some static events, I did following steps. bower install angular-ui-calendar

`

` In UI inserted `
` Into application module injected ui.calendar component and in controller created config and dummy events. `var app = angular.module('myCalendarApp', ['ui.calendar'])` `$scope.eventSources = []; $scope.uiConfig = { calendar:{ height: 450, editable: true, header:{ left: 'month basicWeek basicDay agendaWeek agendaDay', center: 'title', right: 'today prev,next' }, eventClick: $scope.eventClick } }; $scope.eventClick = function(event){ alert("Clicked event === "+event.title); }; var events = [ {title: 'All Day Event',start: new Date('Sun Dec 17 2017 09:00:00 GMT+0530 (IST)')}, {title: 'Long Event',start: new Date('Thu Dec 21 2017 10:00:00 GMT+0530 (IST)'),end: new Date('Thu Dec 21 2017 17:00:00 GMT+0530 (IST)')}, {id: 999,title: 'Repeating Event',start: new Date('Mon Dec 4 2017 09:00:00 GMT+0530 (IST)'),allDay: false} ]; $scope.eventSources = [events];` When I open web page in browser getting following error: `TypeError: calendar.fullCalendar is not a function at Scope.scope.initCalendar (calendar.js:286) at Object.fn (calendar.js:358) at Scope.$digest (angular.js:15896) at Scope.$apply (angular.js:16160) at WindowsCtrl.window.showDialog.$scope.showDialog (windows.controller.js:690) at HTMLSpanElement.onclick (VM1059 windows:1)` Could any one please suggest me how to resolve above issue.
Sujay-shetty commented 6 years ago

@peterver, @petebacondarwin do you have any clue on the above issue

Pablodotnet commented 6 years ago

Did you find the solution for your problem?

Sujay-shetty commented 6 years ago

@Pablodotnet, The point where I injected 'ui.calendar' component was wrong, injected from proper application module resolved the issue for me.