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 - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -