i am trying to access a functionality mentioned in an other controller in some other controoller. Please suggest a way tfor interactions between different controllers residing in different scopes.
Asked
Active
Viewed 106 times
0
-
You can `$broadcast` events between them from `$rootScope` – Kasyx Sep 03 '14 at 07:35
-
1This question has been asked so many times now... what have you tried so far? Did you research the topic? Where is your code? – Yoshi Sep 03 '14 at 07:37
-
possible duplicate of [What's the correct way to communicate between controllers in AngularJS?](http://stackoverflow.com/questions/11252780/whats-the-correct-way-to-communicate-between-controllers-in-angularjs) – Robert Koritnik Sep 03 '14 at 07:47
1 Answers
1
Try to share a scope or transform what you need to share to service.
If you get data from a shared source (server, localstorage) transform the function to a generic service and use this service in both controllers.
If you get a value in one controller and want to use it in another one you can $emit events on rootScope.

raam86
- 6,785
- 2
- 31
- 46