Apologies if the title is incorrect, as I struggled to come up with the best one. Feel free to change it.
Constant File
/* global lodash:false */
(function () {
'use strict';
angular
.module('blocks.router')
.constant('lodash', _);
})();
routerHelper.js File
/* @ngInject */
function routeHelper($location, $rootScope, $state, _, logger, routeHelperConfig)
routeHelper.$inject = ['$location', '$rootScope', '$state', '_', 'logger', 'routeHelperConfig'];
Issue
Although manually injecting the dependencies works fine.
routeHelper.$inject = ['$location', '$rootScope', '$state', 'lodash', 'logger', 'routeHelperConfig'];
However, running ng-annotate cmdline (ng-annotate --single_quotes --add routeHelper.js -o routeHelper.js) produces the following result:
routeHelper.$inject = ['$location', '$rootScope', '$state', '_', 'logger', 'routeHelperConfig'];
You can observe that ng-annoate replaces 'lodash' with '_'.
Inquiry
How can I prevent ng-annoate from substituting 'lodash' with '_'