本文整理匯總了TypeScript中@angular/material.MdDialogRef.afterClosed方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript MdDialogRef.afterClosed方法的具體用法?TypeScript MdDialogRef.afterClosed怎麽用?TypeScript MdDialogRef.afterClosed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@angular/material.MdDialogRef
的用法示例。
在下文中一共展示了MdDialogRef.afterClosed方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: approveItem
approveItem(event, entity: string, entityObject: any, ogKey: string) {
event.stopPropagation();
let dialogRef = this.dialog.open(ApproveDialogComponent);
dialogRef.afterClosed().subscribe(result => {
this.selectedOption = result;
if (this.selectedOption === 'approve') {
if (entityObject.entityKey) {
let ogEntity = this.db.object('/' + entity + '/' + entityObject.entityKey);
ogEntity.valueChanges().take(1).subscribe((item:any) => {
if (entity === 'products' && item.category && entityObject.category) {
this.db.object('/categories/' + item.category + '/products/' + entityObject.entityKey).remove();
this.db.object('/categories/' + entityObject.category + '/products/' + entityObject.entityKey).set(Date.now().toString());
} else if (entity === 'products' && item.category && !entityObject.category) {
this.db.object('/categories/' + item.category + '/products/' + entityObject.entityKey).remove();
} else if (entity === 'products' && !item.category && entityObject.category) {
this.db.object('/categories/' + entityObject.category + '/products/' + entityObject.entityKey).set(Date.now().toString());
}
ogEntity.set(entityObject);
});
} else {
this.db.list('/' + entity).push(entityObject).then((item) => {
if (entity === 'products' && entityObject.category) {
this.db.object('/categories/' + entityObject.category + '/products/' + item.key).set(Date.now().toString());
}
});
}
this.db.object('/approvals/' + entity + '/' + ogKey).remove();
let snackBarRef = this.snackBar.open('Item approved', 'OK!', {
duration: 3000
});
}
});
}
示例2: _openDialog
private _openDialog(config?: MdDialogConfig) {
this.dialogRef = this._dialog.open(TestDialog, config);
this.dialogRef.afterClosed().subscribe(() => {
this.dialogRef = null;
});
}
示例3: confirm
public confirm(
title: string,
message: string,
btnOkText: string = 'Продовжити',
btnCancelText: string = 'Відмінити',
viewContainerRef?: ViewContainerRef): Observable<boolean> {
// Docs: https://material.angular.io/components/component/dialog
// http://www.madhur.co.in/blog/2017/03/26/angular-confirmation-dialog.html
let dialogRef: MdDialogRef<DialogComponent>;
const dialogConfig = new MdDialogConfig();
// FIXME dialogConfig.viewContainerRef = viewContainerRef;
dialogRef = this.dialog.open(DialogComponent, dialogConfig);
dialogRef.componentInstance.title = title;
dialogRef.componentInstance.message = message;
dialogRef.componentInstance.btnOkText = btnOkText;
dialogRef.componentInstance.btnCancelText = btnCancelText;
const result = dialogRef.afterClosed();
return result;
}
示例4: codepeerRunInfo
public codepeerRunInfo(): Observable<boolean> {
let dialogRef: MdDialogRef<CodepeerRunInfoDialog>;
dialogRef = this.dialog.open(CodepeerRunInfoDialog);
return dialogRef.afterClosed();
}
示例5: deleteProduct
deleteProduct(product: any) {
let dialogRef = this.dialog.open(DeleteDialogComponent);
dialogRef.afterClosed().subscribe(result => {
this.selectedOption = result;
if (this.selectedOption === 'delete') {
this.db.object('/products/' + product.key).remove();
if (product.category) {
this.db.object('/categories/' + product.payload.val().category + '/products/' + product.key).remove();
}
// if (product.thumbnail) {
// let storage = firebase.storage();
// let imageRef = storage.refFromURL(product.thumbnail);
// let me = this;
// imageRef.delete().then(function() {
// let snackBarRef = me.snackBar.open('Product deleted', 'OK!', {
// duration: 3000
// });
// }).catch(function(error) {
// console.log('error', error);
// });
// } else {
let snackBarRef = this.snackBar.open('Product deleted', 'OK!', {
duration: 3000
});
// }
}
});
}
示例6: reviewHistory
public reviewHistory(): Observable<boolean> {
let dialogRef: MdDialogRef<ReviewHistoryDialog>;
dialogRef = this.dialog.open(ReviewHistoryDialog);
return dialogRef.afterClosed();
}
示例7: openModal
public openModal(title: string, data: any): Observable<boolean> {
this.dialogRef = this._mdDialog.open(ModalEditAmbulancesComponent, this.configModal);
this.dialogRef.componentInstance.title = title;
this.dialogRef.componentInstance.data = data;
this.dialogRef.componentInstance.dialogRef = this.dialogRef;
return this.dialogRef.afterClosed();
}
示例8: onEditClick
public onEditClick(account) {
let dialogRef = this.dialog.open(ClientAccountDlgComponent, {width: '80%', data: {clientAccount: account}});
dialogRef.afterClosed().subscribe( result => {
if( result) {
this.clientAccountService.getClientAccounts();
}
})
}
示例9: openDialog
openDialog() {
this.dialogRef = this.dialog.open(PizzaDialog, {
disableClose: false
});
this.dialogRef.afterClosed().subscribe(result => {
console.log(result);
this.dialogRef = null;
});
}
示例10: confirm
public confirm(title: string, message: string): Observable<boolean> {
let dialogRef: MdDialogRef<SimpleDialogComponent>;
dialogRef = this.dialog.open(SimpleDialogComponent);
dialogRef.componentInstance.title = title;
dialogRef.componentInstance.message = message;
return dialogRef.afterClosed();
}