Git Product home page Git Product logo

angular-tree-dropdown's Introduction

Angular UIB Tree Dropdown

This is a fork of angular-tree-dropdown by shri-bhat. Original work was executed by him.

This repo contains a cleaned-up version, which also requires angular-uib to work.

Installation

Copy the script and css from the dist/ folder into your project and add a script and link tag to your page.

<script src="angular-uib-tree-dropdown/dist/angular-uib-tree-dropdown.min.js"></script>
<link rel="stylesheet" href="angular-uib-tree-dropdown/dist/angular-uib-tree-dropdown.min.css" />

Add a dependency to your application module.

angular.module('App', ['ui.treeDropdown']);

Add a tree-dropdown to your application. See Usage.

Usage

Attributes of the directive uib-tree-dropdown are as follows:

  • uib-tree-dropdown: the tree dropdown directive.
  • data : the tree model on $scope.
  • selected : selected item.

Here is an example:

<uib-tree-dropdown class="tree-dropdown" data="treeData" selected="selected"></uib-tree-dropdown>

Example model:

$scope.treeData = 
[
  { "id": 1, "name": "Option 1", "children": [
    { "id": 2, "name": "Option 1.1", "children": [
      { "id": 3, "name": "Option 1.1.1"},
      { "id": 4, "name": "Option 1.1.2"}
    ]}
  ]},
  { "id": 5, "name": "Option 2" },
  { "id": 6, "name": "Option 2.1" }
];

Selection

If tree-dropdown item is selected, then that selected tree-dropdown item is saved to $scope.selected. Also default tree-dropdown item selection can be done from the $scope.selected.

License

The MIT License.

angular-tree-dropdown's People

Contributors

anx-ckreuzberger avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.