I'm having quite of an issue here. I use ocLazyLoader to load full calendar and it works well, but when ever I'm trying to include fullCalendar-scheduler as well i'm having this error in JavaScript.
Uncaught TypeError: Cannot set property 'schedulerVersion' of undefined
It looks like it cannot set a variable equals to $.fullCalendar
in the source code of the plugins.
Here are how I instanciate my files :
resolve: {
resources: function($ocLazyLoad) {
return $ocLazyLoad.load([
ASSETS.forms.multiSelect
])
},fullCalendarScheduler: function($ocLazyLoad){
return $ocLazyLoad.load([
ASSETS.core.moment,
ASSETS.extra.scheduler,
]);
},
fullCalendar: function($ocLazyLoad){
return $ocLazyLoad.load([
ASSETS.extra.fullCalendar
]);
},
}
I pass the correct value aswell in the controller.
controller('AccueilCtrl', ['$scope', '$filter', 'fullCalendar', 'fullCalendarScheduler', function($scope, $filter, fullCalendar, fullCalendarScheduler) {
Any ideas on how to fix this?
for those having this problem i found a way to fix it. I don't know if it's the right way to do but it does works.
Fullcalendar required a specifics order to import the required files. Using OcLazyLoad, you can determine this order by using the
files: []
parameters. Ex:This way, i was able to import the required files in the required order. You could also seperate the css from the js in the ASSETS and then import it in the correct order.