本文整理汇总了TypeScript中@angular/material.MatDialogRef类的典型用法代码示例。如果您正苦于以下问题:TypeScript MatDialogRef类的具体用法?TypeScript MatDialogRef怎么用?TypeScript MatDialogRef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MatDialogRef类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: confirm
public confirm(title: string, message: string, customButton: string): Observable<boolean> {
let dialogRef: MatDialogRef<AppComfirmComponent>;
dialogRef = this.dialog.open(AppComfirmComponent, {disableClose: true});
dialogRef.updateSize('380px');
dialogRef.componentInstance.title = title;
dialogRef.componentInstance.message = message;
dialogRef.componentInstance.customButton = customButton;
return dialogRef.afterClosed();
}
示例2: confirm
confirm(title: string, message: string): Observable<boolean> {
let dialogRef: MatDialogRef<ConfirmDialogComponent>;
dialogRef = this._dialog.open(ConfirmDialogComponent);
dialogRef.componentInstance.title = title;
dialogRef.componentInstance.message = message;
return dialogRef.afterClosed();
}
示例3: login
login(message?: string): Observable<boolean> {
let dialogRef: MatDialogRef<LoginDialogComponent>;
const config: MatDialogConfig = new MatDialogConfig();
config.disableClose = true;
dialogRef = this._dialog.open(LoginDialogComponent, config);
dialogRef.componentInstance.message = message;
return dialogRef.afterClosed();
}
示例4: confirm
public confirm(title: string, message: string, preview?: string): Observable<boolean> {
let dialogRef: MatDialogRef<ConfirmDialog>;
dialogRef = this.dialog.open(ConfirmDialog);
dialogRef.componentInstance.title = title;
dialogRef.componentInstance.message = message;
dialogRef.componentInstance.preview = preview;
//dialogRef.componentInstance.preview = this.sanitizer.bypassSecurityTrustHtml(preview);
return dialogRef.afterClosed();
}
示例5: close
close(result?: any): void {
if (result) {
this._dialogRef.close(result);
} else {
this._dialogRef.close();
}
}
示例6: 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;
}
}
示例7: open
public open(title: string = 'Please wait'): Observable<boolean> {
this.dialogRef = this.dialog.open(
AppLoaderComponent,
{ disableClose: true,
backdropClass: 'light-backdrop'
});
this.dialogRef.updateSize('200px');
this.dialogRef.componentInstance.title = title;
return this.dialogRef.afterClosed();
}
示例8: pass
pass() {
const date = new Date();
if (this.option === '1') {
date.setDate(date.getDate() + 1);
}
this.dialogRef.close(date);
}
示例9: open
public open(title: string = T('Please wait')): Observable<boolean> {
this.translate.get(title).subscribe(t => {
this.dialogRef = this.dialog.open(AppLoaderComponent, {disableClose: true});
this.dialogRef.updateSize('200px', '200px');
this.dialogRef.componentInstance.title = t;
});
return this.dialogRef.afterClosed();
}
示例10: 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}`);
}
}