twinssbc / AngularJS-ResponsiveCalendar

A pure AngularJS responsive calendar directive
http://twinssbc.github.io/AngularJS-ResponsiveCalendar/demo/
MIT License
112 stars 77 forks source link

Callback on "Prev" and "Next" click #59

Closed isteven closed 8 years ago

isteven commented 8 years ago

Hi @twinssbc ,

Thanks for the directive, it's really helpful.

I need to create a callback when the next / prev button is clicked. Something similar with this: #40.

As suggested there, I tried using the "range-changed" attribute, but I'm still unable to get my callback function triggered.

My HTML:

<calendar
    calendar-mode="month"    
    range-changed="rangeChanged(startTime, endTime)"
 ></calendar>

My Javascript:

$scope.rangeChanged = function (startTime, endTime) {
    console.log(startTime, endTime); // should print something, but empty
}

Any help would be appreciated. Thanks.

isteven commented 8 years ago

Sorry, please ignore this question, I managed to do it. Will open a new issue.

iamntg commented 8 years ago

@isteven Hi, I am facing the same problem. how did you managed to get this done?

twinssbc commented 8 years ago

@iamntg What's your issue? The rangeChanged callback is not triggered? This callback is only triggered when the queryMode is set to 'remote', did you set it?

iamntg commented 8 years ago

@twinssbc Hey, it was fixed, Thank you. The queryMode need to be set as variable from the controller. I was trying to set it directly from the html.