Function is not executed each time the controllador opens


#1

You might not have much to do with ionic, but I need you every time a view is opened, a function is executed. Have in my view a charge tabs where a list of data using a query I get my webservice. This is executed only once, but what I need is that every time you enter a new data load this view.

.controller('MyCtrl',function($scope){
    $scope.init = function(){
      alert("Hi");
    }
    $scope.init();
}

This function’m testing and runs once.

I also tested with data-ng-init="init()" without success.


#2