Available in the OSS Version

Tree - AngularJS

This sample demonstrates how to create a Tree with an AngularJS directive.

Code View

Copy to Clipboard
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Ignite UI for jQuery Required Combined CSS Files -->
    <link href="http://cdn-na.infragistics.com/igniteui/2024.1/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
    <link href="http://cdn-na.infragistics.com/igniteui/2024.1/latest/css/structure/infragistics.css" rel="stylesheet" />

    <script src="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.8.3.js"></script>
    <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
    <script src="http://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>
    <script src="/js/angular.min.js"></script>

    <!-- Ignite UI for jQuery Required Combined JavaScript Files -->
    <script src="http://cdn-na.infragistics.com/igniteui/2024.1/latest/js/infragistics.core.js"></script>
    <script src="http://cdn-na.infragistics.com/igniteui/2024.1/latest/js/infragistics.lob.js"></script>

    <script src="http://cdn-na.infragistics.com/igniteui/2024.1/latest/js/extensions/igniteui-angularjs.js"></script>

    <script src="/data-files/hierarchical-files.js"></script>
    <script type="text/javascript">
        var sampleApp = angular.module('sampleApp', ['igniteui-directives']);
        sampleApp.controller('treeController', function ($scope) {
            $scope.data = files;
        });
    </script>
</head>
<body>
    <div ng-app="sampleApp" ng-controller="treeController">
        <ig-tree id="tree1" data-source="data">
            <bindings child-data-property="Folder" text-key="Text" value-key="Value">
            </bindings>
        </ig-tree>
    </div>
</body>   
</html>