アプリで ng-annotate と次の構文 (ng-strict-di を使用) を使用して縮小化の問題を回避したいのですが、/** ng@Inject */ コメントがないかのようにコンソールにこのエラーが表示され続けます。 routeConfig 関数の上。
私は何が欠けていますか?
これはエラーです:
**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**
これがルート設定ファイルです。
(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);
}
})();
助けてくれて本当にありがとうございます。