如何使用 nativescript-angular 制作一个预先填充的 radautocompletetextview?
这就是我尝试这样做的方式:
HTML:
<RadAutoCompleteTextView id="rice-cake" (didAutoComplete)="onTokenSelected($event)" marginTop="40px" style="border-width:0.5;border-radius:5px;border-color:#E6E6E6;"
#autocmp [items]="dataItems" suggestMode="Suggest" displayMode="Plain">
<SuggestionView tkAutoCompleteSuggestionView suggestionViewHeight="150">
`enter code here`<ng-template tkSuggestionItemTemplate let-item="item">
<StackLayout orientation="vertical" padding="10">
<Label [text]="item.text"></Label>
</StackLayout>
</ng-template>
</SuggestionView>
</RadAutoCompleteTextView>
打字稿:
this.autocomplete =
<RadAutoCompleteTextView>view.getViewById(this.page,"rice-cake");
console.log(JSON.stringify(this.autocomplete))
var token = new TokenModel(_result.dish, undefined);
this.autocomplete.addToken(token)