batch-autocomplete-lib
v0.0.20
Published
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.13.
Downloads
5
Readme
BatchAutocompleteLib
This library was generated with Angular CLI version 9.1.13.
Installation
npm
npm install batch-autocomplete-lib
yarn
yarn install batch-autocomplete-lib
Integration
Step 1: Import the BatchAutocompleteLib:
import {BatchAutocompleteLibModule} from 'batch-autocomplete-lib';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
@NgModule({
declarations: [AppComponent],
imports: [BatchAutocompleteLibModule.forRoot('DOMAIN_SERVER', 'BATCH_API_KEY')
],
schemas: [
CUSTOM_ELEMENTS_SCHEMA
]
})
export class AppModule {}
Step 2: Add into your component html file.
<bs-address-autocomplete
(selected)='selectEvent($event)'
(handleError)='handleError($event)'
notFoundText='Not found data'
placeholder='Enter your address'
(suggestionList)='suggestionList($event)'>
</bs-address-autocomplete>
Step 3: Add into your component file so you can use below function.
class TestComponent {
selectEvent(item: any) {
// Do Your Exicution with data
console.log('Selected item', item);
}
handleError(error: any){
// Handle error as you want
console.log(error);
}
suggestionList(data: any){
// Suggestion list data
console.log('suggestion list data', data);
}
}