Skip to content

Angular 2 pipe for fuzzy-searching. Powered by Fuse.js

License

Notifications You must be signed in to change notification settings

caiobsouza/ng2-fuse

Repository files navigation

ng2-fuse (NgFuse)

npm version npm downloads

NgFuse provides an Angular 2 pipe for fuzzy-searching.
This package is powered by the awesome and lightweight library Fuse.js.

Installation

npm install ng2-fuse

Usage

Import NgFuseMode in app.module.ts

import { NgFuseModule } from 'ng2-fuse';
@NgModule({
  imports: [
    ...
    NgFuseModule,
    ...
  ],
  ...
})

Using NgFuse within *ngFor directive

<li *ngFor="let item of (collection | ngFuse:queryString:{keys: ['name', 'email']})"></li>

Options

NgFuse uses Fuse.js default options. For more details, see Fuse.js Official Documentation

defaults: NgFuseOptions = {
        shouldSort: true,
        threshold: 0.3,
        location: 0,
        distance: 100,
        maxPatternLength: 32,
        minMatchCharLength: 1,
        minSearchStringLenght: 1
    }

About

Angular 2 pipe for fuzzy-searching. Powered by Fuse.js

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published