Maybe we should make a service for this if we want to share it among directives. I don't think it's good practice polluting the global scope like this. What do you think?