@antin502/ng-multiselect
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Angular 9 Ng MultiSelect

Installation

ng-multiselect is available via npm

Using npm:

$ npm install @antin502/ng-multiselect --save
  • Import NgMultiSelect to your AppModule
import { AppComponent } from './app.component';
import {NgMultiselectModule} from '@antin502/ng-multiselect';

@NgModule({
    imports: [
        ....,
        NgMultiselectModule
    ],
    declarations: [
        AppComponent
    ],
    bootstrap: [AppComponent]
})
export class AppModule {}
  • Use it in your template
      <ng-multiselect [dataList]="list"
                      [compareWith]="compareWith"
                      [(selectedValues)]="selected"
                      [options]="{hide: {selectedItems: false, search: true, selectionAll: true}}"
                      [formatter]="formatter"
      select-all-text="" unselect-all-text="">
      </ng-multiselect>
      ....
      list = [];
      selected = [{id: 1}];
      title = 'ng-multiselect';
    
      formatter = (i) => i.text;
      compareWith = (a) => a.id;
    
      ngOnInit(): void {
        for (let i = 0; i < 100; i++) {
          this.list.push({id: i, text: `id=${i}`});
        }
      }
    
    
      log(e) {
        console.log(e);
      }
      ....

Demo

Creator

Vladimir Antin

Package Sidebar

Install

npm i @antin502/ng-multiselect

Weekly Downloads

2

Version

1.1.0

License

ISC

Unpacked Size

186 kB

Total Files

29

Last publish

Collaborators

  • antin502