Communicating between controllers
See original GitHub issueI know this isn’t exactly an issue, but I think it is a good question. I think of your controllers as controllers for components on a page. How would you suggest to communicate between more controllers?
I have two components List
(data rendered in a list) and ListFilter
(bunch of selects and text inputs). List is loaded using AJAX. It should be reloaded every time ListFilter
changes. I would like to use separate controllers for List
and ListFilter
to keep files small and organized.
So, how to trigger a List
reload when ListFilter
changes?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:38
- Comments:43 (19 by maintainers)
Top Results From Across the Web
What's the correct way to communicate between controllers in ...
Using $rootScope.$broadcast and $scope.$on for a PubSub communication. Also, see this post: AngularJS – Communicating Between Controllers.
Read more >Communicating between Beckhoff controllers part 1: EAP
This posts shows an step by step tutorial for communication between Beckhoff controllers using the EtherCAT Automation Protocol (EAP).
Read more >How to pass data or communicate between Controllers?
The best practice is to have data related to your application in a model class and use the controllers rather than passing data...
Read more >Use Callbacks to Communicate Between Controllers
For instance, you do not want to abuse this method to trigger actions from other controllers. This would defeat the design of StimulusJS...
Read more >Communicating between controllers in AngularJS
Communicating between controllers in AngularJS · When referencing 'someEvent' in the view, angular creates a “$watch” for the $scope. · Upon events occurrence...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
From a Controller instance, you can call
this.application.getControllerForElementAndIdentifier
:We don’t have anything built in for this right now. The easiest thing to do is probably to emit a DOM event from the inner controller and observe it with an action from the outer controller.
What I would like to see eventually is a
data-outlet
attribute that connects delegate properties on a child controller directly to a containing element’s controller. Something like Interface Builder outlets in Cocoa.