Git Product home page Git Product logo

angular-tree-dropdown's Introduction

Angular Tree Dropdown

Pure AngularJS based tree-dropdown directive.

Click Here For Tree Dropdown Demo

Installation

Copy the script and css into your project and add a script and link tag to your page.

<script src="tree-dropdown/tree-dropdown.js"></script>
<link rel='stylesheet' href="tree-dropdown/tree-dropdown.css" />

Add a dependency to your application module.

angular.module('App', ['tree.dropdown']);

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

Usage

Attributes of angular tree-dropdown are below.

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

Here is an example.

<tree-dropdown class="tree-dropdown" data="treeData" selected="selected"></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.

Copyright โ“’ 2015 Shripad Bhat

angular-tree-dropdown's People

Watchers

salah khudairat 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.