After successfully implementing a search function that filters names from an array based on user input, I encountered an issue when trying to make the searchData dynamic by fetching it from a Firebase database:
getArray(): void {
this.afDatabase.list('/imones')
.valueChanges()
.subscribe(res => {
console.log(res)//should give you the array of percentage.
this.array = res;
})
}
this.searchData = this.back.getArray();
constructor(private completerService: CompleterService, private router: Router, public back: BackService,
) {
this.dataService = completerService.local(this.searchData, 'name', 'name');
}
This resulted in an error being thrown:
https://i.sstatic.net/LnS5P.png
I am seeking guidance on how to resolve this issue. Any help is appreciated.