I am having two controllers in two different modules,need to call a child controller function in parent controller.Already tried $rootScope but its not working in this case.
Here is code for child controller function:
$scope.processSignOut = function () {
LogoutService.save(
function (response) {
$state.go('support.login');
}, function (error) {
showAlert('danger',
'logout unsuccessfull. Please try again.');
});
};
Parent Controller
$rootScope.logout = function () {
$rootScope.processSignOut();
};
Html Code
<button type="button" class="btn btn-secondary btn-block"
ng-click="logout()">Logout
</button>