Wrap any global variable in Angular service for dependency injection