I want to know if I can call a $rootScope.$emit inside a $rootScope.$on function, the reason is I have two controllers ctrl1.js and `ctrl2.js,
and I would like to call a method of ctrl2.js inside my ctrl1.js
Im very new to angularjs a minute ago, here is my code, thank you,
/* Ctrl1 */
$rootScope.$on("rootScopeDisplayPage", function(event,target){
$rootScope.$emit("CallAMethodFromCtrl2", target);
});
/* Ctrl2 */
$rootScope.$on("CallAMethodFromCtrl2", function(event, target){
$scope.displayArticle(target);
});
$scope.displayArticle = function(articleStatus){
/* do something */
}
its like a nested $rootScope.$on
Thank You,
