I have two controllers and one service. Could someone explain me why firstname will be not updatet / the reference is "old" when changing it?
I thought this is the way to communicate between controllers...?
<!-- language: lang-js -->
// Controller 1
function controllerOne (..., myService) {
$scope.firstname = myService.customer.firstname;
}
// Controller 2
function controllerTwo (..., myService) {
$scope.firstnameNew = myService.customer.firstname;
}
// Service
application.factory('myService', ...)
function(...) {
return {
customer: {
"firstname": "",
"lastname": "",
"pers": "",
"street": "",
"zip": "",
"city": "",
"selectedCountry": "",
"comment": ""
},
...
}