twinssbc / Ionic-Calendar

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

rangeChanged function callback is not working #74

Open mittalrahul opened 8 years ago

mittalrahul commented 8 years ago
<calendar calendar-mode="mode"
            event-source="eventSource",
            query-mode="remote"
            range-changed="rangeChanged(startTime, endTime)">
       </calendar>

I think the problem is with the queryMode parameter. I am passing remote in it but it is undefined in your directive. https://github.com/twinssbc/Ionic-Calendar/blob/master/dist/js/calendar-tpls.js#L29

mittalrahul commented 8 years ago

It is working if we pass the angular scope variable in the query-mode attribute.

$scope.queryMode = 'remote';
<calendar calendar-mode="mode"
            event-source="eventSource",
            query-mode="queryMode"
            range-changed="rangeChanged(startTime, endTime)">
       </calendar>

But I think it should also work if I pass string in it instead of passing scope variable.

twinssbc commented 8 years ago

@mittalrahul I try to separate the options into two types. One type of option can be directly specified in the html code, they tend to be constant, such as formatDay. Another type of option is bound to the scope variable, as they may change dynamically, eventSource.

I don't want to make one option support both type, as it will be confusing, as the syntax is exactly the same.