GithubHelp home page GithubHelp logo

isabella232 / ng2-combobox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bitexpert/ng2-combobox

0.0 0.0 0.0 68 KB

The only true Angular Combobox component ;)

License: Apache License 2.0

TypeScript 99.23% Shell 0.77%

ng2-combobox's Introduction

About

ng2-combox is an angular2 combobox / dropdown component, which handles remote or local data to display the list.

It is minimal styled and provides parameters for custom classes.

It can be used as a simple select box or as a typeahead / autocomplete field.

Usage

Install
npm i ng2-combobox

Import
import {ComboBoxModule} from 'ng2-combobox';
or
import {ComboBoxComponent} from 'ng2-combobox';

Use
<combo-box [listData]="types" [displayField]="'name'" [valueField]="'value'" [(ngModel)]="model.type"> </combo-box>

Parameters / Inputs

displayField: string;
name of the field in the selected data object which should be displayed. (e.g. data.items or data)

valueField: string;
name of the field in the selected data object which should be considered as value of the field. (e.g. data.items or data) if not set the whole object is the value of the field.

listData: Observable<Object[]> | Object[]
data used for selection list.

remote: boolean = false;
true if you want to use remote data.

clearOnSelect: boolean = false;
true if you want to clear field if a list item was selected.

forceSelection: boolean = true;
true if an item has to be selected.

localFilter: boolean = false;
true if local data should be filtered during typing.

localFilterCaseSensitive: boolean = true;
true if local data filtering should be case sensitive.

typeAheadDelay: number = 500;
delay before triggering search.

inputClass: string = 'form-control';
class to apply to the inner input field

inputPlaceholder: string = ''; value of the placeholder attribute of the inner input field

loadingIconClass: string = 'loader';
class to apply to the loading icon element

triggerIconClass: string = 'trigger';
class to apply to the loading icon element

dataRoot: string = ''; root element for list data (only first level at the moment)

disabledField: string = ''; member of data object which marks object as disabled (sets class and prevent selection)

noMatchesText: string = ''; text to appear when the input text does not match any item of the selection list.

Events / Outputs

onQuery: EventEmitter<string>();
fires during typing has to be handles to refresh remote data from backend

onSelect: EventEmitter<string>();
fires if an item from list is selected

onCreate: EventEmitter<string>();
fires if selection is triggered for an element which is not is the list (only when forceSelection = false)

onBlur: EventEmitter<any>();
fires when field blurs

onInitValue: EventEmitter<string>();
fires when the initial value has been set

Thank you

BrowserStack

Thank you BrowserStack for prodiving us with the infrastructure needed to test ng2-combobox.

License

ng2-combobox is released under the Apache 2.0 license.

ng2-combobox's People

Contributors

chrizzzle avatar pavelaverkiev avatar ploutarchos avatar shochdoerfer avatar supervillainpresident 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.