I wish to use ng-annotate and the following syntax in my app (using ng-strict-di) to avoid minification issues but I keep getting this error in the console as if I was missing the /** ng@Inject */ comment above the routeConfig function.
What am I missing?
This is the error:
**Uncaught Error: [$injector:modulerr] Failed to instantiate module something due to:
Error: [$injector:strictdi] routeConfig is not using explicit annotation and cannot be invoked in strict mode**
And this is the route config file.
(function () {
'use strict';
angular
.module('something')
.config(routeConfig);
/** @ngInject */
function routeConfig($stateProvider, $urlRouterProvider, $locationProvider) {
$stateProvider
.state('home', {
url: '/',
controller: 'MainController'
})
.state('properties', {
url: '/properties',
templateUrl: 'app/components/properties/properties.html',
controller: 'PropertiesController',
controllerAs: 'properties'
})
.state('properties.map', {
templateUrl: 'app/components/properties-map/properties-map.html'
})
.state('properties.grid', {
templateUrl: 'app/components/properties-grid/properties-grid.html'
})
.state('property', {
url: '/property/:id',
templateUrl: 'app/components/property/property.html',
controller: 'PropertyController',
controllerAs: 'property'
});
$urlRouterProvider.otherwise('/');
$locationProvider.html5Mode(true);
}
})();
Many thanks for your help.