0
I wonder how I can call a function that is in another controller example:
I am in the 'Register' view and after making a registration I am redirected to view
'Home' no controller
from Home I have a function that receives a parameter.
You can call the Home function by passing a parameter being in Register?
Example:
.controller('HomeCtrl', function($scope, $state) {
$scope.myFunction = function(valor) {
alert(valor);
}
})
.controller('AddCtrl', function($scope, $state) {
$scope.add = function() {
$state.go('tab.home');
//Ir para tela Home e chamar a função myFunction('teste')
//passando 'teste' como parãmtro
}
})
Poxa André Vicente, I found this solution very good and practical! Thanks friend, this solves my case. Thanks!!
– Anderson