ng-strict-di не распознает ngInject
Я использую Rails 4.0 с AngularJS 1.5 и гемом ng-annotate. Я заметил, что когда я надеваю 'ng-strict-di', который заставляет вас аннотировать все ваши прямые инъекции в AngularJS, я обнаруживаю, что Rails жалуется на модули, в которых есть "ngInject".
например; Вот мой контроллер приложения для Angular
ApplicationController = (
$scope, $timeout,
hotkeys
ShortcutService) ->
"ngInject"
<SNIP>
Я включил ng-strict-di в своем шаблоне
<html ng-app='paisApp' ng-strict-di>
Когда я запускаю свое приложение в режиме разработки, я получаю сообщение об ошибке в консоли;
Error: [$injector:strictdi] ApplicationController is not using explicit annotation and cannot be invoked in strict mode
http://errors.angularjs.org/1.5.11/$injector/strictdi?p0=ApplicationController
minErr/<@http://localhost:3000/assets/angular/angular.self.js?body=1:69:12
annotate@http://localhost:3000/assets/angular/angular.self.js?body=1:4006:17
injectionArgs@http://localhost:3000/assets/angular/angular.self.js?body=1:4733:21
instantiate@http://localhost:3000/assets/angular/angular.self.js?body=1:4784:18
$controller@http://localhost:3000/assets/angular/angular.self.js?body=1:10608:18
controllerDecorator/<@http://localhost:3000/assets/app/bower_components/angular-material-data-table/dist/md-data-table.self.js?body=1:321:12
compile/<@http://localhost:3000/assets/angular-ui-router/angular-ui-router.self.js?body=1:9781:46
bind/<@http://localhost:3000/assets/angular/angular.self.js?body=1:1260:15
invokeLinkFn@http://localhost:3000/assets/angular/angular.self.js?body=1:10153:9
nodeLinkFn@http://localhost:3000/assets/angular/angular.self.js?body=1:9552:11
compositeLinkFn@http://localhost:3000/assets/angular/angular.self.js?body=1:8811:13
publicLinkFn@http://localhost:3000/assets/angular/angular.self.js?body=1:8691:30
lazyCompilation@http://localhost:3000/assets/angular/angular.self.js?body=1:9048:16
updateView@http://localhost:3000/assets/angular-ui-router/angular-ui-router.self.js?body=1:9719:38
configUpdatedCallback@http://localhost:3000/assets/angular-ui-router/angular-ui-router.self.js?body=1:9663:25
configureUIView@http://localhost:3000/assets/angular-ui-router/angular-ui-router.self.js?body=1:5640:17
ViewService.prototype.sync@http://localhost:3000/assets/angular-ui-router/angular-ui-router.self.js?body=1:5645:9
activateViews@http://localhost:3000/assets/angular-ui-router/angular-ui-router.self.js?body=1:6273:5
invokeCallback@http://localhost:3000/assets/angular-ui-router/angular-ui-router.self.js?body=1:1580:20
TransitionHook.prototype.invokeHook@http://localhost:3000/assets/angular-ui-router/angular-ui-router.self.js?body=1:1592:26
TransitionHook.runAllHooks/<@http://localhost:3000/assets/angular-ui-router/angular-ui-router.self.js?body=1:1719:48
TransitionHook.runAllHooks@http://localhost:3000/assets/angular-ui-router/angular-ui-router.self.js?body=1:1719:9
transitionSuccess@http://localhost:3000/assets/angular-ui-router/angular-ui-router.self.js?body=1:3432:13
processQueue@http://localhost:3000/assets/angular/angular.self.js?body=1:16697:28
scheduleProcessQueue/<@http://localhost:3000/assets/angular/angular.self.js?body=1:16713:27
$eval@http://localhost:3000/assets/angular/angular.self.js?body=1:17995:16
$digest@http://localhost:3000/assets/angular/angular.self.js?body=1:17809:15
$apply@http://localhost:3000/assets/angular/angular.self.js?body=1:18103:13
done@http://localhost:3000/assets/angular/angular.self.js?body=1:12083:36
completeRequest@http://localhost:3000/assets/angular/angular.self.js?body=1:12292:7
requestLoaded@http://localhost:3000/assets/angular/angular.self.js?body=1:12220:9
<div id="wrapper" ui-view="" class="ng-scope" data-ng-animate="1">
angular.self.js:14200:18
Если я аннотирую это вручную, ошибка исчезнет для этого файла. У меня много файлов angularJS, поэтому я не хочу делать это для каждого.
Обновить
Я использую свой сервер с NG_FORCE=true, вот так;
NG_FORCE=true RAILS_ENV=development bundle exec rails s