What is the simplest way to call a controller's functions from another controller?
I have controller like this..
Controller1
$scope.setTitleKey = function (titleKey) {
$scope.currentTitleKey = titleKey;
$scope.getDetails();
};
Controller2
$scope.getDetails= function () {
if (titleKey !== "All") {
$scope.bookInfo;
bookDetails.getBookDetails(titleKey).then(function (results) {
$scope.bookInfo = results.data;
}, function (error) {
alert(error.data.message);
}
);
};
};
I just want to call function from other controller
The simple logic is that if the function from Controller1 then the another function is call from the Controller2
Any Idea?