
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
angular-tree-view
Advanced tools
A dynamic tree view directive that can be used with ui-router for navigation.
A dynamic tree view directive for Angular 1.5.*
$ npm install angular-tree-view
The code is on Github.
Check out all of the demos on Github Pages.
Right now the module uses Font Awesome classes to display the expand/collapse chevrons (arrows/icons) on categories. Although I plan to make that configurable in the future, an easy work around for now is to define a few classes you want to use to style the icons. By creating the classes fa-chevron-right (to be shown when the node is collapsed) and fa-chevron-down (to be shown when the node is expanded) you'll be able to define how the arrows should look. Or you can just use Font Awesome, but I'd advise against that if you're going to import it just for this.
In case you can't tell I'm brand new to Github and npm so I'm going to do my best to document and update this directive as quickly and as often as I can. If something is frustrating to you, I welcome input so please reach out and let me know. Thanks!
You can check out the APIs on the Github Pages site by expanding API and choosing which directive you want (hint: you probably want to look at the Tree View Item API unless you're using your own item template).
To use angular-tree-view with the built-in item template (recommended) reference the eaTreeView-tpls.min.js file. If you use npm to get the package you'd reference /node_modules/angular-tree-view/dist/eaTreeView-tpls.min.js.
To use angular-tree-view with a custom item template (advanced) reference the eaTreeView.min.js file. If you use npm to get the package you'd reference /node_modules/angular-tree-view/dist/eaTreeView.min.js. You must also use the template-url option on the directive to specify where your custom template is.
If you decide to create your own item template, please refer to the Tree View Item API to see what scope properties are passed from the Tree View directive.
The default item template markup looks like this:
<div ng-class="{'tree-trunk': !hasParent()}">
<div data-ng-if="hasChildren()" class="tree-parent" data-ng-class="{'tree-child': hasParent()}">
<div data-ng-click="toggleExpanded()" class="clickable">
<i class="fa" data-ng-class="{'fa-chevron-right': !item.expanded, 'fa-chevron-down': item.expanded}"></i>
<span>{{item.display}}</span>
</div>
<ea-tree-view data-ng-if="item.expanded" branch-name="{{branchName}}" dataset-id="datasetId" callback="callback" items="item.items"></ea-tree-view>
</div>
<div data-ng-if="!hasChildren()" data-ng-click="activate()" class="tree-child clickable" data-ng-class="{active: item.isActive}">{{item.display}}</div>
</div>
As you can see in the default markup we make use of three built-in Angular directives: ng-class, ng-if, and ng-click. Keep in mind that this markup is repeated for each child in the tree structure so making this too big or complex might cause problems!
branch-name attribute in the directive. Otherwise, all of your nested children will need to be named 'items'.is-root attribute is what allows the tree to expand properly on navigation so be sure to include that if you're using the tree view for navigation purposeseaTreeViewFactory.setItems is how everything gets wired up to select the active item and expand the tree on navigation so make sure to do that!eaTreeViewFactory.bind().eaTreeViewFactory.bind() to do so: (eaTreeViewFactory.bind('someEvent')).clickableactivetree-parenttree-childFAQs
A dynamic tree view directive that can be used with ui-router for navigation.
We found that angular-tree-view demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.