angular-ui / ui-calendar

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

Register calendar before initialize #382

Open neilvana opened 8 years ago

neilvana commented 8 years ago

Client code can define hooks for fullCalendar in the options that can be called during initialization. For example if a caller specifies "viewRender" and inside viewRender they would like to access the calendar object, this isn't possible since the uiCalendarConfig is not yet configured. By adding the new calendar to uiCalendarConfig before calling fullCalendar(options) it allows clients to define these functions.

neilvana commented 8 years ago

I also had to update the angular dependency since 1.4.1 didn't seem to be available anymore.

tetyanochka commented 7 years ago

Hi I need this change too. Do you have you any idea, when it can be merged to the master? And how do you think, maybe such change has to be in this method also:

                    eventSourcesWatcher.onAdded = function (source) {
                        if (calendar && calendar.fullCalendar) {
                   (2)     calendar.fullCalendar(options);
                   (1)     if (attrs.calendar) {
                                uiCalendarConfig.calendars[attrs.calendar] = calendar;
                            }
                            calendar.fullCalendar('addEventSource', source);
                            sourcesChanged = true;
                        }
                    };