2.0.4 • Published 2 years ago

ngm-live-search v2.0.4

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

NgmLiveSearch

This library was generated with Angular CLI version 13.2.0.

Demo

https://stackblitz.com/edit/angular-ivy-kdr5j4?file=src/app/app.component.html

Version

For Angular version 14 use version 2 of this library

Installation

Install npm i ngm-live-search with npm

  cd my-project
  npm i npm i ngm-live-search

Usage/Examples

import { NgmLiveSearchModule } from "ngm-live-search";

@NgModule({
  imports: [
    .
    .
    .
    NgmLiveSearchModule
  ],
})
export class AppModule {}

Then in your component.html

<ngm-live-search (search)="yourSearch($event)" (searchClosed)="clearSearch()">
</ngm-live-search>

Then in your component.ts

export class YourComponent {
  /**
   * @params text: the text to search.
   */
  yourSearch(text: string) {
    // Call api or search locally on your data.
    // this.callApi() In case of call api.
    // this.localSearch() In case of local search.
  }

  clearSearch() {
    // Stop filtering your data
  }

  callApi() {}

  localSearch() {}
}

API Reference

Inputs

ParameterTypeDescription
configISearchParamsdebounceTime, minLength, clearOnBlur

Outputs

ParameterTypeDescription
searchstringReturns the string to search
searchClosedstringon click on x button
2.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago