Let's take for example this(user edit) page:
http://img38.imageshack.us/img38/6032/4gg6.png
and the controller for this page:
function userEditCtrl($scope) {
$scope.user = {
personalData: {
firstName: '...',
lastName: '...'
},
contacts: [{}, {}, {}],
someOtherData: {
field: 'value'
}
};
}
in the page we have 3 sections (personal data, contacts and some other data), in the user object we also have corresponding fields.
what is the best practice for creating separate controller for every section (userPersonalDataEditCtrl, userContactsEditCtrl, userSomeOtherDataEditCtrl)?
Thank You!