你好,我以前在角度以下没有遇到过的事情是我的代码:
showDirectoryList(){
const showMyDirectoryList:Modal =
this.showContactsModal.create(ModalShowDirectoryPage);
showMyDirectoryList.present();
showMyDirectoryList.onDidDismiss((data)=>{
this.directoryList.push(data);
});
}
此代码打开一个列表模式,然后通过IonDidDimsiss()
获取所选的ID。我甚至能够将它显示在我的视图中,但显然当我进行测试时,它会显示空白现在我想知道为什么当它看到项目被推入输入文本框时它是空的。
这是我的代码的html:
<ion-navbar color="beacon-green">
<ion-title>Create A Broadcast</ion-title>
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
</ion-navbar>
<ion-content padding>
<form [formGroup]="sendBroadCastForm" novalidate (ngSubmit) ="send(sendBroadCastForm.value)">
<div class="form-group">
<input type="text" formControlName="broadcastName" placeholder="Campaign Title"/>
</div>
<div class="spacer-10"></div>
<div class="form-group">
<input type="text" formControlName="msisdnList" placeholder="To:"/>
</div>
<div class="spacer-10"></div>
<div class="form-group">
<div class="row">
<div col-10>
<input type="text" formControlName="phonebookIds" [(ngModel)]="phonebookIds" placeholder="Directory List" value="{{[directoryList]}}">
</div>
<div col-1>
<ion-icon name="add-circle" color="beacon-orange" float-right (click)="showDirectoryList()"></ion-icon>
</div>
</div>
</div>
<div class="spacer-10"></div>
<div class="form-group">
<div class="row">
<ion-item>
<ion-label>Broadcast Date</ion-label>
<ion-datetime displayFormat="YYYY/MM/DD" formControlName="broadcastDate"></ion-datetime>
</ion-item>
<div class="spacer-10"></div>
<ion-item>
<ion-label>Broadcast Time</ion-label>
<ion-datetime displayFormat="HH:mm:ss" formControlName="broadcastTime"></ion-datetime>
</ion-item>
</div>
</div>
<div class="spacer-30"></div>
<div class="form-group">
<textarea rows="6" cols="33" formControlName="message"></textarea>
</div>
<div class="spacer-20"></div>
<p class="draftTime" [hidden]="!autoSaveDetails">Draft saved at: {{autoSaveDetails|date:"mediumTime"}}</p>
<div class="spacer-30"></div>
<ion-fab bottom center>
<button type="submit" ion-fab color="beacon-orange" ><ion-icon name="paper-plane"></ion-icon></button>
</ion-fab>
</form>
</ion-content>
我想知道是什么造成的,如果有人能指出我做错了什么。谢谢。