I have two controllers visible in separate views at the same time.
I need to update view A from view B
When I send POST while viewing get-by-id page and when I watch view A ( list of items ) I want the update of that single post. Can I force the controller to get the information again and update the scope or.
Any thoughts ?
You could use $broadcast to communicate between sibling scopes.
If you have a master scope and two children scopes (one for view A and one for view B), you can do a broadcast from the master scope to inform the children that something happenned, and then in scope A you listen to that particular broadcast.
|- Scope A
|- Scope B
in the B controller, when your envent occurs, you can use :
This will emit a broadcast from the master scope which can be intercepted in the A controller :
In there your function() will be the one which updates your A scope.
Answered By – CCH
Answer Checked By – Pedro (AngularFixing Volunteer)