hi, if i understand your question : you need to keep the state of several
services "somewhere" in order to be able to *use* it (change it & follow
these changes ...) in different controllers and services ... and your
question is :what is this "somewhere" ?
I think you should put the state in another service and inject that service
wherever you need to *use* the state .. or in other words no
service/controller/directive can access this state unless it depends
(dependency injection) on that service .
So the directive that turns on & off the other services should look
something like this
app.directive("turner", function turner(thingsCollectionService) {
return {
link: function turnerLink(scope, elm, attrs, ctrl) {
//when user clicks or sth ...
thingsCollectionService.turnOff("thing1");
}
}
});
i hope that helps :)
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.