本文整理汇总了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);
}