0.0.14 • Published 4 years ago

filtered-select v0.0.14

Weekly downloads
53
License
-
Repository
-
Last release
4 years ago

Filtered Select for Angular

Ultra simple clone of Select2 written in pure Angular 10 No additional dependencies

https://github.com/timbophillips/angular-components-workspace/tree/master/projects/filtered-select

https://www.npmjs.com/package/filtered-select

Usage

StackBlitz example

CLI

npm install --save filtered-select

In app.module.ts:

import { FilteredSelectModule } from "filtered-select";
...
@NgModule({
  // Added FilteredSelectModule
 imports: [..., FilteredSelectModule],
...

In Angular HTML Template

<filtered-select
    [options]="options"
    [lines]="8"
    [backgroundColor]="'white'"
    (chosenOption)="onResult($event)"
    [grouped]=true
  >
 </filtered-select>`

In Angular component TS file

import { option } from 'filtered-select';

const options: option[] = [
  { text: 'Tim', id: 'TP', group: 'Parents' },
  { text: 'Ben', id: 'BP', group: 'Parents' },
  { text: 'Katie', id: 'KP', group: 'Parents' },
  { text: 'John', id: 'JP', group: 'Grandparents' },
  { text: 'Sue', id: 'SP', group: 'Grandparents' },
  { text: 'Sarah', id: 'SR', group: 'Parents' },
  { text: 'Claire', id: 'CB', group: 'Parents' },
  { text: 'Drew', id: 'AM', group: 'Parents' },
  { text: 'Molly', id: 'MP', group: 'Kids' },
  { text: 'Lucy', id: 'LP', group: 'Kids' },
  { text: 'Jess', id: 'JP2', group: 'Kids' },
  { text: 'George', id: 'GP', group: 'Kids' },
  { text: 'Daisy', id: 'DM', group: 'Kids' },
  { text: 'Benny', id: 'BP', group: 'Nicknames' },
  { text: 'Timbo', id: 'TP', group: 'Nicknames' },
  { text: 'Richo', id: 'SR', group: 'Nicknames' },
];
0.0.12

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago