Angular2和Typescript如何使用Angular2和Typescript

时间:2017-12-31 12:05:49

标签: angular typescript

Hai我有一个地址字段,其中在添加弹出字段中我希望当我打开新弹出窗口时地址字段为空但现在它预填充了先前输入的地址,并且在编辑字段中我想要该特定地址行可编辑但现在是空的。

HTML:

添加PopUP:

 <button (click)="add()"> </button>

地址栏:

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

编辑字段:

<button  (click)="edit(page)"></button>

TS:

add() {
  this.new_page = new NewPage();
  this.addPage.show();
}

edit(page) {
    this.editPage.show();
    this.edit_page = page;
}
autoCompleteCallback2(selectedData:any) {
    this.address=selectedData.data.formatted_address;
    this.location=selectedData.data.geometry.location;
    }

0 个答案:

没有答案