AngularJS-ResponsiveCalendar
AngularJS-ResponsiveCalendar copied to clipboard
Call a method on Next and Previous icon click
Hai @twinssbc
I like to call a method on Previous and Next icon click.
E.g:
I have a controller in body tag. Name is my_controller.
I have declared a method here.
I like to call the method while click on the Next or previous icon.
Please suggest.
Best nishadotcom
@nishadotcom There's a rangeChanged callback you can use, please kindly check the README for the detail. Let me know if it can meet your requirement. Thanks.
Hai @twinssbc
Thanks for the instruction, I wrote a separate method called Test() but I could not access it and I did not get the result.( The result would be simple alert)
Please suggest.
Best nishadotcom
@nishadotcom could you provide your related html and js files so that I can have a look?
Hai @twinssbc
Sure.
Controller angular.controller('myController', function ($scope) { $scope.get_date = function (date_param) { alert(date_param); }; });
I need to alert the date when I click on Next or Previous button by clicking.
Best nishadotcom
@nishadotcom How do you use your get_date function in html file?
Hai @twinssbc
I need to call it on ng-click.
@nishadotcom I still don't know where do you call this get_date function. In calendar.html, the ng-click is already bound to move function, did you replace it using your get_date function? Is it possible your get_date function is defined in another scope that can't be reached to?
<div class="nav-right col-xs-2">
<button type="button" class="btn btn-default btn-sm" ng-click="move(1)"><i
class="glyphicon glyphicon-chevron-right"></i></button>
</div>
Hai @twinssbc
I call the method as semicolon separated
Yes, It is not reaching out. So I am getting your input.
The thing is I need to get data from service for the particular month.
Best nishadotcom
@nishadotcom Instead of customizing the calendar internal behaviour, why not using the callback the calendar exposes?
rangeChanged
The callback function triggered when the range or mode is changed if the queryMode is set to 'remote'
$scope.rangeChanged = function (startTime, endTime) {
Events.query({startTime: startTime, endTime: endTime}, function(events){
$scope.eventSource=events;
});
};