本文整理匯總了TypeScript中@angular/material.MatDialogRef.close方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript MatDialogRef.close方法的具體用法?TypeScript MatDialogRef.close怎麽用?TypeScript MatDialogRef.close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@angular/material.MatDialogRef
的用法示例。
在下文中一共展示了MatDialogRef.close方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: handleSyncStatus
private handleSyncStatus(status: DatabaseSyncStatus) {
switch (status) {
case DatabaseSyncStatus.started:
this.syncInProgress = true;
if (!this._sessionService.isLoggedIn()) {
this.dialogRef = this.dialog.open(InitialSyncDialogComponent);
}
break;
case DatabaseSyncStatus.completed:
this.syncInProgress = false;
if (this.dialogRef) {
this.dialogRef.close();
}
this.alertService.addInfo('Database sync completed.');
break;
case DatabaseSyncStatus.failed:
this.syncInProgress = false;
if (this.dialogRef) {
this.dialogRef.close();
}
this.alertService.addWarning('Database sync failed.');
break;
case DatabaseSyncStatus.pulledChanges:
this.alertService.addInfo('Updated database from server.');
this.syncInProgress = true;
setTimeout(() => this.syncInProgress = false, 1000);
break;
case DatabaseSyncStatus.pushedChanges:
this.syncInProgress = true;
setTimeout(() => this.syncInProgress = false, 1000);
break;
}
}
示例2: close
close(result?: any): void {
if (result) {
this._dialogRef.close(result);
} else {
this._dialogRef.close();
}
}
示例3: pass
pass() {
const date = new Date();
if (this.option === '1') {
date.setDate(date.getDate() + 1);
}
this.dialogRef.close(date);
}
示例4: applySelection
applySelection() {
const instance = this.yamcs.getInstance();
const selectedOption = this.selectionList.selectedOptions.selected[0];
const newInstance = selectedOption.value;
this.dialogRef.close();
if (instance.name !== newInstance) {
this.router.navigateByUrl(`/monitor/displays/browse?instance=${newInstance}`);
}
}
示例5: ok
ok(): void {
if (this.message && this.message.length > 0) {
this.dialogRef.close({
fromName: this.fromUser.fullName,
fromEmail: this.fromUser.email,
subject: this.subject,
message: this.message,
});
}
}
示例6:
onClickListener: (ref: MatDialogRef<DialogComponent>, customData: any) => {
ref.close({
customData,
result: DialogResult.SAVE
});
}
示例7: closePopup
closePopup() {
this.dialogRef.close();
}
示例8: select
select(){
const footer = new LayoutBody();
this.dialog.close(footer);
}