I am trying to communicate between two controllers in my case
I have something like
html
<div ng-controller='testCtrl'>
<div ng-click='clickBtn()'>clikc me</div>
</div>
..other contents...
<div ng-controller='testTwoCtrl'>
other contents...
</div>
JS
app.controller('testCtrl', function($scope) {
$scope.clickBtn = function(){
alert('hey')
}
}
app.controller('testTwoCtrl', function($scope) {
//is there anyway to know if clickBtn method is called from here?
}
I was hoping to know if there is a way to notify testTwoCtrl if the button is clicked. Thanks for the help!