angularjs - Onsenui app add custom function on navigator click -


i develop onsenui app on monaca , i'd add custom function on on-right-button-click event :

<ons-navigator    title="mytitlte"   right-button-icon="fa fa-lg fa-refresh"   on-right-button-click="refresh()"   page="pages/msg.html"> </ons-navigator> 

my refresh() function defined in controller

moduleapp.controller('myctrl', ['$scope', '$http', function ($scope, $http) {      // refresh items    $scope.refresh = function () {     ....    }; }]); 

thanks help

you need set "mycontroller" on navigator or above navigator.

<ons-navigator   ng-controller="mycontroller"    title="mytitlte"   right-button-icon="fa fa-lg fa-refresh"   on-right-button-click="refresh()"   page="pages/msg.html"> </ons-navigator> 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -