2016-10-27 6 views
1

私は角度ブートストラップを使用しようとしていますが、何らかの理由で不明なプロバイダエラーが発生しています。

すべてが整然としているように見えます。下のbower.jsonファイルにあるように、私は最新バージョンをインストールしました。

angular 
    .module('clientApp', [ 
    'ngAnimate', 
    'ngCookies', 
    'ngResource', 
    'ui.router', 
    'ngSanitize', 
    'ngTouch', 
    'ui.bootstrap', 
    'oitozero.ngSweetAlert' 
    ]) 

そして、私は私のコントローラに注入しています:

.controller('BalanceWheelController', function($scope, $uibModal, lessons, $state) { 

{ 
    "name": "client", 
    "version": "0.0.0", 
    "dependencies": { 
    "angular": "^1.5.8", 
    "bootstrap-sass-official": "^3.2.0", 
    "angular-animate": "^1.4.0", 
    "angular-cookies": "^1.4.0", 
    "angular-resource": "^1.4.0", 
    "angular-route": "^1.4.0", 
    "angular-sanitize": "^1.4.0", 
    "angular-touch": "^1.4.0", 
    "angular-ui-router": "^0.3.1", 
    "jquery": "^2.2.0", 
    "angular-xeditable": "^0.2.0", 
    "oclazyload": "^1.0.9", 
    "angular-motion": "^0.4.4", 
    "angular-local-storage": "^0.5.0", 
    "angular-sweetalert": "latest", 
    "angular-password": "^1.0.3", 
    "ng-file-upload-shim": "^12.2.12", 
    "ng-file-upload": "^12.2.12", 
    "ng-img-crop": "ngImgCrop#^0.3.2", 
    "ngvideo": "^1.0.2", 
    "angular-bootstrap": "^2.2.0" 
    }, 
    "devDependencies": { 
    "angular-mocks": "^1.4.0" 
    }, 
    "appPath": "app", 
    "moduleName": "clientApp", 
    "overrides": { 
    "bootstrap": { 
     "main": [ 
     "less/bootstrap.less", 
     "dist/css/bootstrap.css", 
     "dist/js/bootstrap.js" 
     ] 
    } 
    }, 
    "resolutions": { 
    "angular": "~1.x" 
    } 
} 

は、私は私のモデルへの参照を追加しました:ここ

は私のbower.jsonファイルです

モーダルを呼び出す関数は次のとおりです。

 var modalInstance = $uibModal.open({ 
      animation: true, 
      backdrop: 'static', 
      keyboard: false, 
      templateUrl: 'questionsModal.html', 
      controller: function($scope, $uibModalInstance, SweetAlert) { 

       $scope.close = function() { 
        //self.showingExpenses = false; 
        $uibModalInstance.close(); 
        videoId.play(); 
       }; 
      } 
     }); 

だから私は、私は次のエラーを取得しています理由としては本当に困惑している:ここで

angular.js:10160 Error: [$injector:unpr] Unknown provider: $templateRequestProvider <- $templateRequest <- $uibModal 
http://errors.angularjs.org/1.2.32/$injector/unpr?p0=%24templateRequestProvider%20%3C-%20%24templateRequest%20%3C-%20%24uibModal 
    at http://localhost:9000/bower_components/angular/angular.js:78:12 
    at http://localhost:9000/bower_components/angular/angular.js:3803:19 
    at Object.getService [as get] (http://localhost:9000/bower_components/angular/angular.js:3931:39) 
    at http://localhost:9000/bower_components/angular/angular.js:3808:45 
    at getService (http://localhost:9000/bower_components/angular/angular.js:3931:39) 
    at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:3958:13) 
    at http://localhost:9000/bower_components/angular/angular.js:3809:37 
    at getService (http://localhost:9000/bower_components/angular/angular.js:3931:39) 
    at invoke (http://localhost:9000/bower_components/angular/angular.js:3958:13) 
    at Object.instantiate (http://localhost:9000/bower_components/angular/angular.js:3978:23) <div ui-view="" class="ng-scope"> 

はindex.htmlの中で、私のjsの参照です:

<script src="bower_components/jquery/dist/jquery.js"></script> 
<script src="bower_components/angular/angular.js"></script> 
<script src="bower_components/bootstrap-sass-official/assets/javascripts/bootstrap.js"></script> 
<script src="bower_components/angular-animate/angular-animate.js"></script> 
<script src="bower_components/angular-cookies/angular-cookies.js"></script> 
<script src="bower_components/angular-resource/angular-resource.js"></script> 
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script> 
<script src="bower_components/angular-touch/angular-touch.js"></script> 
<script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script> 
<script src="bower_components/angular-xeditable/dist/js/xeditable.js"></script> 
<script src="bower_components/angular-local-storage/dist/angular-local-storage.js"></script> 
<script src="bower_components/sweetalert/dist/sweetalert.min.js"></script> 
<script src="bower_components/angular-sweetalert/SweetAlert.js"></script> 
<script src="bower_components/angular-password/angular-password.js"></script> 
<script src="bower_components/ng-file-upload/ng-file-upload.js"></script> 
<script src="bower_components/ng-file-upload-shim/ng-file-upload-shim.js"></script> 
<script src="bower_components/ng-img-crop/compile/minified/ng-img-crop.js"></script> 
<script src="bower_components/angular-mocks/angular-mocks.js"></script> 
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script> 
<script src="bower_components/angular-bootstrap/ui-bootstrap.min.js"></script> 
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script> 
+0

そのルックスであることを、すべての角度依存性のバージョンと一致して提案しますui-bootstrap.js? –

+0

@NikhilVM '$ uibModal'は存在しますが、' $ templateRequest'は存在しません。間違った '.js'ファイルかもしれません。 – Phil

+1

@NikhilVMあなたは何を意味するのかよくわかりません。これは 'ngTouch'、 ( 'ui.bootstrap'、) 'oitozero.ngSweetAlert' – cnak2

答えて

2

あなたがきました$templateRequestプロバイダを持たないAngular 1.2.32(エラーURLのバージョンに注意してください)をインストールすることができました。これは1つ(またはそれ以上)の依存関係を介して発生しています。

resolutionsangular依存バージョンに合わせて変更してください。

"resolutions": { 
    "angular": "^1.5.8" 
} 

あなたがそこにいる間、私はあなたがのために参照を追加するために逃したようにあなたが正確同じ、すなわちangular-animateangular-mocksなど

+0

ありがとうございます。それはトリックでした!皆さん、助けてくれてありがとう。 – cnak2

関連する問題