angularjs tree view is not working getting module error

227 Views Asked by At

I am trying to use angularjs for creating tree view and I am getting module error. I am trying to follow this link https://github.com/eu81273/angular.treeview

I followed the steps added the js and css file in the html added the

<div data-angular-treeview="true"
                 data-tree-id="abc"
                 data-tree-model="treedata"
                 data-node-id="id"
                 data-node-label="label"
                 data-node-children="children">
            </div>

then in controller

var CIController = angular.module('CIController', ['ngMaterial', 'ngAnimate', 'ngAria', 'ngMessages', 'Alertify', 'ngFileUpload', 'angularTreeview',])
 $scope.treedata =
            [
                {
                    "label": "User", "id": "role1", "children": [
                        { "label": "subUser1", "id": "role11", "children": [] },
                        {
                            "label": "subUser2", "id": "role12", "children": [
                                {
                                    "label": "subUser2-1", "id": "role121", "children": [
                                        { "label": "subUser2-1-1", "id": "role1211", "children": [] },
                                        { "label": "subUser2-1-2", "id": "role1212", "children": [] }
                                    ]
                                }
                            ]
                        }
                    ]
                },
                { "label": "Admin", "id": "role2", "children": [] },
                { "label": "Guest", "id": "role3", "children": [] }
            ];   
        $scope.$watch('abc.currentNode', function (newObj, oldObj) {
            if ($scope.abc && angular.isObject($scope.abc.currentNode)) {
                console.log('Node Selected!!');
                console.log($scope.abc.currentNode);
            }
        }, false);

But I am getting error in chorome console like module error. Kindly help to resolve this issue. AngularJS v1.3.15 is the version I am using.

0

There are 0 best solutions below