NOTE -
If you not provide the filtername on providing the array list of objects it will throw ERROR.
- no-record-text -
This is use when you want to show when no record found.
Example -
no-record-text="No Records Found!"sh[ng4-auto-complete]="countryList"
[word-trigger]="2" [list-length]="10"
filterName="name" no-record-text="No Records Found!" >
`Set Dynamic List -
For Dynamic List we can inject the Service i.e
AutoCompleteServicein your component and set it when you get the list like this -
`sh
import { AutoCompleteService } from 'ng4-auto-complete';
export class YourComponent{ constructor(public autoCompleteService: AutoCompleteService){ }
//call this method when you get list from anywhere
setList(list){
this.autoCompleteService.setDynamicList(list);
// this will log in console if your list is empty.
}
}
`
Update List -
For Update List we can inject the Service i.e
AutoCompleteServicein your component and set it when you get the list like this -
`sh
import { AutoCompleteService } from 'ng4-auto-complete';
export class YourComponent{ constructor(public autoCompleteService: AutoCompleteService){ }
//call this method when you want to update list from anywhere
//elementId ,is the id od input tag which you want to change
updateList(list,elementId){
this.autoCompleteService.updateList(list, elementId);
}
}
`NOTE -
------
- It always sets String in the input ( on any list(
String or Object