我正在使用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”。