私はGrails 2.4.4で私もAngularJSを使っているプロジェクトを持っています。angels-annotate-asset-pipelineがGrails 2プロジェクトで全く機能しない
私はAsset Pipeline Pluginと一緒にAngularJs Annotate Asset-Pipelineを使用することに決めました。静的資産(js、cssなど)の処理、縮小などのための最初のものと、angularJSが依存する注入依存性のために、それを必要とするすべての機能にmyFunc.$inject = [...]
「注入」を得るための第2のものです。
戦争が必要なときに私のjsファイルに生成されようとしているが、真が異なる場合、それはmyFunc.$inject=[]
を置くべきAngularJs Annotate Asset-Pipelineのドキュメントによると:それはすべてで動作していない(私はどの$inject
で表示されません縮小さファイルと広くSO上で議論dependency injectionによるアプリブレーク(例:Angularjs error Unknown providerとAngularJS Error: $injector:unpr Unknown Provider)以下
は(他が必要な場合、私に知らせてください)関連するコードです
BuildConfig .groovy
compile "org.grails.plugins:asset-pipeline:1.9.9"
compile "org.grails.plugins:angular-annotate-asset-pipeline:2.4.1"
AngularJSコントローラ(これは単なる一例である)
angular
.module('app', [])
.controller('myCtrl', myCtrl);
/*@ngInject*/ // << --- did not work!
function myCtrl ($scope){
//I also used the "ngIngect"; alternative here and it did not work either!
$scope.myVar = "sample text";
}