2 ms·
What works well for me is having the service return an object (named `data`) alongside the functions like `logout`, which contains another object with the actua
by arvidkahl 12y ago
What works well for me is having the service return an object (named `data`) alongside the functions like `logout`, which contains another object with the actual model (`user`). Then, in controllers, I assign it to $scope.data and $watch('data.user') which reflects the changes in the controller since it this object is being shared by reference among all controllers and directive that inject the service.