I have two ngControllers in one ngApp. I'd like to data bind the model from one controller with another.
Here's an example of my controllers:
ViewUsers: Is a list view of users
UserDetail: Is a detailed view of a single user
When the user clicks on a userRow(model:$scope.users[n]) in ViewUsers, it's calling a global function that creates a new instance of UserDetail.
But I want to send the $scope.users[n] in the constructor of UserDetail or something by reference so any changes to the modelin my UserDetail controller will be reflected in the userRow from the ViewUsers controller.
So for example, when you change the name in the detailed view, it'll be relected in the list view on the side.
Are services the route I need to go? Or $watch?
Any advice would be appreciated, Thanks!