0

I have separate angularjs component (angularjs version 1.5.9) that is integrated in angularjs application. My component do something and i want to notify my parent application to some work on the particular action taken by the component.

P.S. I don't want to use $emit & $broadcast events to notify the parent application.

I'm curious to know that is there's any other way to implement this thing. Any help or suggestions will be appreciated. Thanks in advance.

Mohit
  • 522
  • 4
  • 10
  • Is there a reason why you don't want to use events? – karthick May 19 '17 at 03:41
  • Yes, there are already many event registered on the parent .js file. I don't want to listen other events there as it will impact the performance of that page i.e load time. It is parent js file that already invoke service calls plus if i add other events to be listened then it will surely hamper the performance that is not apt. – Mohit May 19 '17 at 03:50

1 Answers1

0

Instead of using $emit & $broadcast events you can use event bus.

checkout the article at : http://jonathancreamer.com/an-angular-event-bus-with-postal-js/

Also check- What's the correct way to communicate between controllers in AngularJS?

What's the correct way to communicate between controllers in AngularJS?

Community
  • 1
  • 1
Newcomer
  • 25
  • 2
  • 9