I use angular 1.3.x.
I have one big form. In a first step, I can edit the person name in the form so I have an object person bind to the scope and an input with ng-model:
$scope.person = { name: 'John' };
Later, in the same form, I have a list of contacts (which is person like above) and in this list I can have again the SAME person as previous.
I want that the person can be edited in the first part or last part of the form: if I change the name in the first input, it must be changed in the second input and vice versa.
I tries to do something like that:
$scope.contacts = [];
$scope.contacts.push(person);
The second form is correctly filled but if I change the name in the first input field, the second input field isn't updated.
Any idea how to do that? Thanks in advance.
$scope.contacts? If so this should work since you are sharing the same object reference.