![](/img/trans.png)
[英]Why is it that whenever i enable a rotate animation on my angular component.ts my application becomes blank?
[英]I need to close the popup message in component.ts in angular4
在component.html中,我目前有一個彈出消息,打開和關閉功能在html中,但是我需要一種方法中的關閉功能
<ng-template #content let-c="close" let-d="dismiss">
<div class="modal-header">
<button type="button" class="close" aria-label="Close"
(click)="d('Cross click')">
<span aria-hidden="true">×</span>
</button>
<h4>Cinema Operator</h4>
</div>
<div class="modal-body">
<li class="nav-item"> Import from your Excel </li>
</div>
<div class="modal-footer">
<input type="file" accept=".xlsx" class="btn btn-
success"(change)="onFileChange($event)">
<button type="file" class="btn dark btn-outline"
(click)="c('Close click');uploadfile()">Upload</button>
</div>
</ng-template>
----------------------------------------------------
<button class="btn btn-default" *ngIf="message" (click)="open(content)">Add New Operator</button>
open(content)將打開彈出消息,c('Close click')將關閉Component.html中的彈出消息,但是我需要在uploadfile()方法中使用此關閉功能,請幫我解決此問題
我認為您所需要做的就是將引用傳遞給該函數,
模板面:
變更:
(click)="c('Close click');uploadfile()"
至
(click)="uploadfile(c)"
組件側:
uploadfile(c){
... // your code
c('Close click');
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.