本文整理汇总了TypeScript中@angular/material/dialog.MatDialogRef类的典型用法代码示例。如果您正苦于以下问题:TypeScript MatDialogRef类的具体用法?TypeScript MatDialogRef怎么用?TypeScript MatDialogRef使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MatDialogRef类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: async
async(inject([MatDialog, MatDialogRef], (dialogSpy: MatDialog, dialogRef: MatDialogRef<any>) => {
const event = component.initEvent(lessons[0]);
const saveLessonSpy = spyOn(component, 'saveLesson');
component.editLesson(event, false);
expect(dialogSpy.open).toHaveBeenCalledWith(LessonEditorComponent, {
autoFocus: false,
data: lessons[0]
});
dialogRef.afterClosed().subscribe((result) => {
expect(result).toBeFalsy();
expect(saveLessonSpy).not.toHaveBeenCalled();
});
dialogRef.close(null);
})));
示例2: continue
continue() {
this.dialogRef.close(Math.round(Number(this.form.value.quantity)));
}
示例3: closePopup
closePopup() {
this.dialogRef.close();
}
示例4: closeDialog
closeDialog() {
this.dialogRef.close();
}
示例5: closePopup
closePopup() {
if (!this.disableDismiss) {
this.dialog.close();
}
}
示例6:
this.purchaseService.generate(this.form.value.address).subscribe(() => this.dialogRef.close());
示例7: closePopup
closePopup(language: LanguageData = null) {
this.dialogRef.close(language ? language.code : undefined);
}