2017-04-08 8 views
3

angularjsプロジェクトに角度メッセージモジュールをインストールしてインポートする際に問題が発生しています。ここにエラーメッセージがありますブレードインストール後にAngularjsアプリケーションにngMessagesモジュールを含めることはできません

Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to: 
Error: [$injector:modulerr] Failed to instantiate module ngMessages due to: 
Error: [$injector:nomod] Module 'ngMessages' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. 
http://errors.angularjs.org/1.6.4/$injector/nomod?p0=ngMessages 
    at http://localhost:8000/bower_components/angular/angular.js:66:12 
    at http://localhost:8000/bower_components/angular/angular.js:2262:17 
    at ensure (http://localhost:8000/bower_components/angular/angular.js:2183:38) 
    at module 

以下からわかるように、私は角度メッセージモジュールを適切にインポートしたと思います(index.html)。

また、ファイルパスのイメージと、ngMessageのインポートを実行する私のapp.jsのイメージも含まれています。 BowerのバージョンもOKです。何かご意見は?

enter image description here

enter image description hereenter image description here

enter image description here

+1

コードを画像ではなくテキストとして投稿してください。すべての角度依存性に同じバージョン番号を使用します。 –

答えて

1

ng-messagesのバージョンは、AngularJSのバージョンと互換性がありません。依存関係の設定で厳密なバージョンを試してください:

{ 
    "name": "angular-seed", 
    "version": "0.0.0", 
    "private": true, 
    "dependencies": { 
    "angular": "1.6.0", 
    "angular-route": "1.6.0", 
    "angular-loader": "1.6.0", 
    "angular-mocks": "1.6.0", 
    "angular-messages": "1.6.0" 
    } 
}