I would like to know how I can do to call a function that is in another controller example:
I am in the 'Cadastro' view and after registering I am redirected to view
'Home' in controller
of Home I have a function that receives a parameter.
Can you call the Home function by passing a parameter while 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
}
})