2

私は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 providerAngularJS 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"; 
} 

答えて

1

短い答え:

変更依存のバージョンこの

形態:

に掘りした後

compile "org.grails.plugins:angular-annotate-asset-pipeline:1.1.3"

長い話

、と私は著者の結論に来た友人が提供する助けを借りて、このから

compile "org.grails.plugins:angular-annotate-asset-pipeline:2.4.1" 

このプラグインはその内部のロジックを削除しました。

このプラグイン(2.4.1)の現在のバージョンでは、現在(2001年5月25日)には誰も使用することができません。

誰かがこの同じ問題を経験している場合は、バージョン1.1.3を使用してください。これは、正常に使用できた最新バージョンです。

関連する問題