I have navigation module with some details (NavigationModel). I have modules (SubCtrl1, SubCtrl2..) that can be selected from Navigation part(NavigationCtrl). Each modules have own model with different properties and some shared. If I change some value (property shared between models) in selected module (SubCtrl1), I want to have updated in navigation details section (NavigationCtrl).
What's correct way to do this?
function NavigationCtrl(){
var vm = this;
vm.NavigationModel = {};
vm.NavigationModel.Name = "Test";
}
function SubCtrl1(){
var vm = this;
vm.SubModel= ...
}
<input ng-model="subCtrl1.SubModel.Name"></input>
When I change value in input field, I want to have that value in NavigationModel.
EDIT: I checked next question What's the correct way to communicate between controllers in AngularJS?