GithubHelp home page GithubHelp logo

formio / ng2-select Goto Github PK

View Code? Open in Web Editor NEW

This project forked from valor-software/ng2-select

0.0 5.0 2.0 3.2 MB

Angular2 based replacement for select boxes

Home Page: http://valor-software.github.io/ng2-select/

License: MIT License

JavaScript 14.92% TypeScript 47.37% CSS 33.20% HTML 4.51%

ng2-select's Introduction

Native UI Select Angular2 component (demo)

ng2-select npm version npm downloads

Follow me twitter to be notified about new releases.

Angular 2 Style Guide Code Climate Build Status Join the chat at https://gitter.im/valor-software/ng2-bootstrap devDependency Status Throughput Graph

Quick start

  1. A recommended way to install ng2-select is through npm package manager using the following command:

npm i ng2-select --save

  1. Include ng2-select.css in your project

  2. More information regarding of using ng2-select is located in demo and demo sources.

API

Properties

  • items - (Array<any>) - Array of items from which to select. Should be an array of objects with id and text properties. As convenience, you may also pass an array of strings, in which case the same string is used for both the ID and the text. Items may be nested by adding a children property to any item, whose value should be another array of items. Items that have children may omit having an ID. If items are specified, all items are expected to be available locally and all selection operations operate on this local array only. If omitted, items are not available locally, and the query option should be provided to fetch data.
  • active (?Array<any>) - selection data to set. This should be an object with id and text properties in the case of input type 'Single', or an array of such objects otherwise. This option is mutually exclusive with value.
  • allowClear (?boolean=false) (not yet supported) - Set to true to allow the selection to be cleared. This option only applies to single-value inputs.
  • placeholder (?string='') - Placeholder text to display when the element has no focus and selected items.
  • disabled (?boolean=false) - When true, it specifies that the component should be disabled.
  • multiple - (?boolean=false) - Mode of this component. If set true user can select more than one option. This option only applies to single-value inputs, as multiple-value inputs don't have the search input in the dropdown to begin with.

Events

  • data - it fires during all events of this component; returns Array<any> - current selected data
  • selected - it fires after a new option selected; returns object with id and text properties that describes a new option.
  • removed - it fires after an option removed; returns object with id and text properties that describes a removed option.
  • typed - it fires after changing of search input; returns string with that value.

Troubleshooting

Please follow this guidelines when reporting bugs and feature requests:

  1. Use GitHub Issues board to report bugs and feature requests (not our email address)
  2. Please always write steps to reproduce the error. That way we can focus on fixing the bug, not scratching our heads trying to reproduce it.

Thanks for understanding!

License

The MIT License (see the LICENSE file for the full text)

ng2-select's People

Contributors

aslubsky avatar buchslava avatar el-besto avatar feedyourmind avatar greenkeeperio-bot avatar jhuntoo avatar kfbishop avatar linusbrolin avatar namek avatar natali-abyss avatar qweritos avatar ronzeidman avatar valorkin avatar wolvenone27 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

jazizi forkedit

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.