How to use $emit and $on of angularjs for two different controller stored in different path
问题 I have two views and its resp controller. Say view1.html and its controller firstCntrl and view2.html and its controller secndCntrl. In view1.html : There is Link2 which will be redirected to view2.html if it is clicked. <a href="#/view1" ng-click="emit()">Link1</a> <a href="#/view2" ng-click="emit()">Link2</a> in ng-click I am calling emit function where I defined $emit as firstCntrl.js app.controller("firstCntrl", function ($scope) { $scope.emit = function() { $scope.$emit('send', { message