tru-autocomplete
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

TruAutocomplete

Enables users quickly search or filter through a pre-populated list as a user type. It provides suggestion in a dropdown while typing into the field.

Installation

Install through NPM:

npm install tru-autocomplete --save

Usage

Import AutocompleteModule

...
import { TruAutocompleteModule } from 'tru-autocomplete';

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

In your compenent.html

<tru-autocomplete 
placeholder = "Search"
[filterFrom]="arrayList" 
[(ngModel)]="text">
    Label Name
</tru-autocomplete>

In your component.ts

...
export class AppComponent {
  text: any;
  arrayList = ['mobolarinwa', 'Henry', 'Kelechi', "Okonkwo", 'Morgan', 'Truparse', 'Mobile'];
}

Adding your own css using inputClass for the input field and dropdownClass for dropdown

<tru-autocomplete 
placeholder="search"
[filterFrom]="arrayList" 
inputClass= "form-control" 
dropdownClass = "dropdown-class"
[(ngModel)]="text">
    Label Name
</tru-autocomplete>

Developers

Know more about Truparse.

Package Sidebar

Install

npm i tru-autocomplete

Weekly Downloads

10

Version

1.0.6

License

none

Unpacked Size

142 kB

Total Files

27

Last publish

Collaborators

  • hnexokonkwo