twinssbc / Ionic-Calendar

A calendar directive for Ionic framework
http://twinssbc.github.io/Ionic-Calendar/demo
MIT License
159 stars 73 forks source link

Issue where the events aren't showing if using ng-if and query-mode remote #39

Open winstonpang opened 8 years ago

winstonpang commented 8 years ago

So if we have something like this:

queryMode is set to 'remote'.

For some reason when I toggle the conditions, the calendar is not displaying the events.

This happens if the view loads initially showing the ion-list only, then you swtich to the advanced calendar view, none of the events show up.

I've tried doing a $scope.$broadcast('eventSourceChanged', mySource); whenever I change the modes, but it doesn't seem to be doing anything.

twinssbc commented 8 years ago

@squaredonut Is the calendar itself displayed correctly? Only the events aren't shown? When you call $scope.$broadcast('eventSourceChanged', mySource), what's inside mySource array? And you mentioned ng-if, where do you use it? Could you help to debug it? In calendar-tpls.js, add break point on the below lines, to see if the onEventSourceChanged is triggered or not?

scope.$on('eventSourceChanged', function (event, value) {
                    calendarCtrl.onEventSourceChanged(value);
                });