I have a constant app.constant('DOCUMENT_ID', window.documentId || 1); which I inject into services, controllers and directives.
I want to change DOCUMENT_ID to be a global variable, so that if I change DOCUMENT_ID's value in controller, I want to get the changed value in all services and controllers in which DOCUMENT_ID was injected.
How can I use a global variable in this way?