angular-ui / ui-calendar

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

scope.calendar.fullCalendar is not a function #250

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hi,

so my (your) code crashes in line 226:

scope.init = function(){ scope.calendar.fullCalendar(options); };

because at this point scope.calendar is undefined. I don't see any code where it's actually initialized, although I'm really only a JS beginner.

I then tried your demo (using Angular 1.3.15) and got the following error: [ng:areq] Argument 'CalendarCtrl' is not a function, got undefined I downgraded Angular to v1.2.1 and then the calendar is shown but I still get this error: uiCalendarConfig.calendars is undefined

So... any way of getting my code to run with Angular 1.3.15? I haven't found any combination where even the demo works without errors.

Any help would be appreciated.

danielj86 commented 9 years ago

Same here

joshkurz commented 9 years ago

can you create a plunker please?

On Thu, Apr 9, 2015 at 10:46 AM, danielj86 notifications@github.com wrote:

Same here

— Reply to this email directly or view it on GitHub https://github.com/angular-ui/ui-calendar/issues/250#issuecomment-91252406 .

Josh Kurz www.joshkurz.net

ghost commented 9 years ago

Sorry, nevermind. It was due to JQuery being loaded before Angular. Now it works fine.

vapits commented 9 years ago

Same here, and it;s not jquery issue in my case.

Here's my code:

<div class="calendar" ng-model="eventSources" data-calendar="myCalendar" data-config="uiConfig.calendar" data-ui-calendar="uiConfig.calendar"></div>
 var view = $scope.myCalendar.fullCalendar('getView');
console.log(view.intervalStart._d);

Generally i have an other issue, calendar is not loaded if i refreh the browser, i must refresh the browser from an other route and the got to the calendar page to view the calendar.