0.1.17 • Published 7 years ago

ng2-choices v0.1.17

Weekly downloads
22
License
MIT
Repository
github
Last release
7 years ago

ng2-choices

The simplest library for multiple choices in Angular.

  • No dependencies
  • Simplest

http://i.imgur.com/AerIXxA.png

1. Install

npm install ng2-choices --save

2. Using

2.1 .html

<ng2-choices [options]="options" 
            (change)="change($event)" 
            [choices]="choices"></ng2-choices>

2.2 .component

choices: ChoiceModel[] = [
    { title: 'Angular', checked: false },
    { title: 'React', checked: false },
    { title: 'Vue', checked: false },
    { title: 'Ember', checked: false },
    { title: 'Preact', checked: false },
    { title: 'Aurelia', checked: false }
  ];

2.3 .app.module

import { Ng2ChoicesComponent } from './ng2-choices/build';

@NgModule({
  declarations: [
    AppComponent,
    Ng2ChoicesComponent
  ],
  imports: [
    ...
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

options

Default options

options = <ChoiceOptions>{
    multiple: true
};

events/ functions

change(item): Will fire whenever you checked/unchecked any items.

  • item: item which is checking/ un-checking.
0.1.17

7 years ago

0.1.16

7 years ago

0.1.15

7 years ago

0.1.14

7 years ago

0.1.13

7 years ago

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago