uiCalendarConfig.calendars is undefined #195
Comments
(also tried with bower's latest version of ui-calendar (0.8.1) and the latest beta1) |
are you injecting uiCalendarConfig into your controller's context? |
Yes, .controller('CalendardemoCtrl', function ($scope,$compile,uiCalendarConfig) { .. At what moment are the calendar objects from my view injected in this config, on load of the controller or do I need to listen to an ivent? |
they are created once the calendar library sets them, so initially if you As a work around, you could do a watch on the length on the calendars array On Thu, Dec 11, 2014 at 10:58 AM, Jonas Windey notifications@github.com
Josh Kurz |
Even when everything is loaded and I add a button that calls uiCalendarConfig.calendars, it's still undefined.
in controller:
Anything I could be doing wrong? I've looked to the source of ui-calendar and actually I don't see the exact place where he adds the calendar to the uiCalendarConfig.calendars ? |
I found the issue. If you install with bower version 0.9.0-beta1 (bower install angular-ui-calendar#0.9.0-beta.1) Could you bump the version of bower? |
Hello, I have exactly the same issue. But a clean fix would be far better. BR, /*
angular.module('ui.calendar', [])
}])
}]); |
for sure, will release a new version soonish. On Fri, Dec 12, 2014 at 6:30 AM, jrzeznik notifications@github.com wrote:
Josh Kurz |
Thanks to @jrzeznik post I can get access to the uiCalendarConfig.calendars list but actually the list is empty... > uiCalendarConfig.calendars
< Object {} ... when there should be at least one element: <div ui-calendar="uiConfig.calendar" ng-model="eventSources" calendar="myCalendar"> I've checked all my bower dependencies and they seem to be correct. "angular-ui-calendar": "0.9.0-beta.1",
"fullcalendar": "2.1.1" Any suggestions/ideas why can't I see the myCalendar in controller? edit: |
@jonaswindey gives us the fixed. Just go to the github and copy calendar.js and replace it to bower_components\angular-ui-calendar\src Apparently, bower is not updated with the latest fix. |
+1 for this issue. Manually patching it isn't a solution for me though. Will wait for a bower update. |
+1 |
2 similar comments
+1 |
+1 |
As a workaround, I find somewhere (...you know Google) an answer to access the Example:<div ng-controller="ScheduleController as schedule">
<div ui-calendar="schedule.config.calendar" calendar="calendar" ng-model="schedule.eventSources"></div>
</div> angular.module('schedule', ['ui.calendar'])
.controller('ScheduleController', ScheduleController);
function ScheduleController($scope, $timeout, uiCalendarConfig) {
this.config = {...};
this.eventSources = [{...}];
// ʕ•ᴥ•ʔ <( ... )
$timeout(function () {
// ᕕ( ᐛ )ᕗ <( Yippee! )
$scope.calendar.fullcalendar('render');
});
} Hope that helps! |
As an alternative workaround, instead of patching calendar.js you can include the git repository and commit id in your bower.json dependencies. Adding the following line in dependencies solved the issue for me:
|
+1 thanks @Reidsy that works with uiCalendarConfig object ! |
I'm experiencing somewhat similar problems even with the latest calendar.js. <div id="calendar" ui-calendar="uiConfig.calendar" ng-model="myEvents" calendar="myCalendar"></div> console.log(uiCalendarConfig);
console.log(uiCalendarConfig.calendars); Gives: Object {calendars: {myCalendar: n.fn.init[1] ...
Object {} So |
I was experiencing same issue @Reidsy sollution worked for me ... |
Bump. Almost six months have been passed now and still there is no clean fix to this issue (the bower update way) :( |
turn that frown upside down. Should be good now. :) On Fri, May 8, 2015 at 9:47 AM, Diosney Sarmiento notifications@github.com
Josh Kurz |
I tested it and it grabbed the 1.0 version, which is already ok. Thanks :) |
Hi, i want display in calendar view many json objects from my rest api : my broblem : I can display this static json objects fron my controller in the calendar, but when I called my rest api to retrieve the json events they no longer appear in the calendar. controller:
}]); think's ;) |
how i can set initial month and year in ui-calander |
This works for me (ui-calendar v1.0.2): HTML:
Controller:
|
For me it does not..any ideas? |
When using ui-calendar edited events are not updated. to |
When trying to run the demo, I get:
undefined is not an object (evaluating 'uiCalendarConfig.calendars[calendar]')
Tried with both fullcalendar 2.1.1 (as in bower's depencency), or the newest (2.2.3)
The text was updated successfully, but these errors were encountered: