如何在角度4中将数据分配给ng4geo-autocomplete?

时间:2018-10-12 07:28:31

标签: angular typescript

我正在使用ng4geo-autocomplete,并且尝试以两种方式绑定数据,但无法正常工作

html:

<ng4geo-autocomplete  (componentCallback)="autoCompleteCallback1($event)" [userSettings]="userSettings"></ng4geo-autocomplete>

ts代码:

userSettings = {
    "showSearchButton":false,
    "inputPlaceholderText":"Address",
}
autoCompleteCallback1(selectedData:any) {
    this.userSettings.inputPlaceholderText = selectedData.data.description;
    }

    this.httpService.get(UrlDetails.$getOrganizationByIdUrl + "/" + _id, {}).subscribe((response) => {
this.userSettings.inputPlaceholderText =response.address;
});

当我在获得响应后将值分配给inputPlaceholderText时,其不反映在UI上并显示默认值“ Address”。

0 个答案:

没有答案