Nativescript-autocomplete not working in Router


#1

Hi,
I am using this plugin in my Nativescript + Angular android app project. It is working excellent on first page but when i navigate to another page it throwing an silent error saying setAdapter of undefined.

My code is:
app.module.ts
import { registerElement } from “nativescript-angular/element-registry”;
registerElement(“AutoComplete”, () => require(“nativescript-autocomplete”).AutoComplete);

app.component.html
<AutoComplete [items]=“genders” (itemTap)=“onItemTap($event)”>

app.component.ts
genders: Array = [‘Male’,‘Female’,‘Other’];
onItemTap(args){
console.log(args.data);
}

It is working fine in app.component.html

I have another html named register.html. I am using the same code and i am navigating to this html using router page-router-outlet
this.router.navigate[’/register’]

in register page it throwing error Cannot read property ‘setAdapter’ of undefined on itemsUpdate

Please guide me how to resolve this issue


#2

is this plugin working in iOS without router ???