2017-01-16 21 views
0

angular-bootstrap-nav-treeライブラリを使用しようとしていますが、私のモジュールの依存関係リストに 'angularBootstrapNavTree'を追加しています。あなたがいないコントローラの依存関係では、依存関係のごモジュールのリストに追加する必要があり、実際にエラー "Unknown provider: angularBootstrapNavTreeProvider <- angularBootstrapNavTree"モジュールの依存関係リストに依存関係を追加するにはどうすればいいですか?

angular. 
    module('myApp'). 
    component('treeList', { 
     template: ' <abn-tree tree-data="my_data"></abn-tree>', 
     controller: function MyCtrl($http, $scope, dataContext, angularBootstrapNavTree) {    
      $scope.my_data = [{ 
       label: 'Languages', 
       children: ['Jade','Less','Coffeescript'], 
       classes: ["special", "red"] 
      }]  
    }); 
+0

を持っていますあなたは以下のファイルを適切に含んでいますか? ** abn_tree_directive.js **、 ** abn_tree.css ** – Korte

+0

@Korte、はい、持っています。 –

答えて

0

が、私はそれを修正:

angular. 
    module('myApp'). 
    component('treeList', { 
     template: '<abn-tree tree-data="my_data"></abn-tree>', 
     controller: function MyCtrl($http, $scope, dataContext, angularBootstrapNavTree) {    
      $scope.my_data = [{ 
       label: 'Languages', 
       children: ['Jade','Less','Coffeescript'], 
       classes: ["special", "red"] 
      }];  
     } 
    }); 

さらに、あなたはモジュールの依存関係にangularBootstrapNavTreeを追加するのを忘れた可能性があります。

angular.module('myApp', ['angularBootstrapNavTree']); 
0

があります。あなたが;とあなたのsynthaxで}を逃した

angular.module('myApp',['angularBootstrapNavTree']) 
関連する問題