ngx-select-options
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

ngx-select-options

Easy to use Angular >= 2 module that replaces default HTML select input with more advended dropdown - combobox style. Features options search. Works perfectly with Angular ngModel directive.

How to install

Install package with npm

npm install ngx-select-options --save

Import in your module file:

import {NgxSelectOptions} from 'ngx-select-options'

And then include this module in import section in @NgModule

imports: [
    NgxSelectOptions,
    ...
]

How to use in code

Instead of default select input use code down below

<ngx-select-options placeholder="Select option" [(ngModel)]="valueModel" [options]="options" ngDefaultControl></ngx-select-options>
Parameter Description
placeholder Text displayed on dropdown button
ngModel Angular data binding
options Array of options in dropdown

Array options structure

Options data displayed on dropdown shoud have structure like this:

[
  {
    label: 'Option label',
    value: 123
    },
    {...}
]

Optional you can use also key value that defines selected value on dropdown button (instead of placeholder, when value is already selected).

Package Sidebar

Install

npm i ngx-select-options

Weekly Downloads

2

Version

1.0.5

License

ISC

Last publish

Collaborators

  • jar555