0

I'm trying to use angular-bootstrap-nav-tree library, but I'cant add 'angularBootstrapNavTree' to my module's list of dependencies. There is error "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"]
          }]      
     });
2
  • Have you included the following files properly ? abn_tree_directive.js, abn_tree.css Commented Jan 16, 2017 at 15:57
  • @Korte , yes, I have. Commented Jan 16, 2017 at 15:59

2 Answers 2

0

You missed a ; and a } in your synthax, I fixed it:

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"]
          }];      
      } 
   });

Furthermore, you may have forgot to add angularBootstrapNavTree to your module dependencies:

angular.module('myApp', ['angularBootstrapNavTree']);
Sign up to request clarification or add additional context in comments.

Comments

0

You have actually to add it to your module's list of dependencies, not in controller's dependencies.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.