Hey there! I've got this shared_service factory that's being used by my menu and other elements on the page.
angular.module('shared_service', []).
factory('Shared', function($scope){
var shared_service = {
something: 'something',
something_else: 'something_else'
};
//I'm looking to set up a watcher for 'something' in order to update 'something_else'
//$scope.$watch('shared_service.something', function(){
// something_else += 1;
//}
return shared_service;
});
I know I could potentially attach the watcher in a controller, but personally, I feel like it belongs here. Do you think it's feasible to have it here?
Appreciate any advice or input you might have. Thanks!