How to Use nativescript-autocomplete plugin with angular?


#1

I want to use plugin with angular project template .GitHub shows only code in native and XML. I am not able show on page.
relevant code i am using
detail.componet.ts
registerElement(“AutoComplete”, () => require(“nativescript-autocomplete”).AutoComplete);
public list :Array = [‘1’,‘2’,‘3’,‘4’,‘567’] ;
detail.component.html

 

i am getting exception this.items.forEach is not a function inside plugin code .that line is with definition of AutoComplete.prototype.itemsUpdate inside autocomplete.android.js plugin source


#2

HTML:

<AutoComplete [items]=“items” (itemTap)=“itemTapped($event)”>

TS:

public items[];
this.items = [“Afghanistan”, “Albania”, “Algeria”, “American Samoa”];

main.ts:

import * as elementRegistryModule from “nativescript-angular/element-registry”;

elementRegistryModule.registerElement(“AutoComplete”, () => require(“nativescript-autocomplete”).AutoComplete);


#3

This wont work with pagerouter