• When you need to dispatch the event from child controller to scopes upwards you can use $scope.$emit.
  • In above code controllers are showing their own value on Html and when you will click on text you will get values in console .
  • 1) For Parent- Child controller — Using $scope of parent controller to emit/broadcast events.
  • controller: function($scope) { this.publicMethodOnParentDirective = function() { // Do something } }
  • If Second controller is child ,you can use Parent child communication .

Read more


JavascriptQnA

@JavascriptQnA: “Can one controller call another? #javascript #html #angularjs” open tweet »