當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript MdDialog.open方法代碼示例

本文整理匯總了TypeScript中@angular/material.MdDialog.open方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript MdDialog.open方法的具體用法?TypeScript MdDialog.open怎麽用?TypeScript MdDialog.open使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@angular/material.MdDialog的用法示例。


在下文中一共展示了MdDialog.open方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: openDialog

 openDialog(cardIndex: number, imgIndex: number, extra?: boolean) {
   if (!extra) {
     this.dialog.open(ImageModalComponent, {
       data: this.cards[cardIndex].content[imgIndex]
     });
   } else {
     this.dialog.open(ImageModalComponent, {
       data: this.cards[cardIndex].extraContent[imgIndex]
     });
   }
 }
開發者ID:nathanhnew,項目名稱:nathansweather-legacy,代碼行數:11,代碼來源:tropics.component.ts

示例2: openDialog

 openDialog(component): void {
    let dialogRef = this.dialog.open(component);

    dialogRef.afterClosed().subscribe(result => {
      console.log('The dialog was closed');
    });
  }
開發者ID:phdulac,項目名稱:Billings,代碼行數:7,代碼來源:dialog.service.ts

示例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;
    }
開發者ID:rostag,項目名稱:bigpolicy_eu,代碼行數:25,代碼來源:dialog.service.ts

示例4: 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
        });
      }
    });
  }
開發者ID:mogeta,項目名稱:firebase-cms,代碼行數:34,代碼來源:admin-approvals.component.ts

示例5: reviewHistory

    public reviewHistory(): Observable<boolean> {
        let dialogRef: MdDialogRef<ReviewHistoryDialog>;

        dialogRef = this.dialog.open(ReviewHistoryDialog);

        return dialogRef.afterClosed();
    }
開發者ID:AdaCore,項目名稱:gnatdashboard,代碼行數:7,代碼來源:dialog.service.ts

示例6: codepeerRunInfo

    public codepeerRunInfo(): Observable<boolean> {
        let dialogRef: MdDialogRef<CodepeerRunInfoDialog>;

        dialogRef = this.dialog.open(CodepeerRunInfoDialog);

        return dialogRef.afterClosed();
    }
開發者ID:AdaCore,項目名稱:gnatdashboard,代碼行數:7,代碼來源:codepeer-dialog.service.ts

示例7: _openDialog

  private _openDialog(config?: MdDialogConfig) {
    this.dialogRef = this._dialog.open(TestDialog, config);

    this.dialogRef.afterClosed().subscribe(() => {
      this.dialogRef = null;
    });
  }
開發者ID:BernhardRode,項目名稱:material2,代碼行數:7,代碼來源:dialog-e2e.ts

示例8: 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
          });
        // }
      }
    });
  }
開發者ID:mogeta,項目名稱:firebase-cms,代碼行數:29,代碼來源:admin-products.component.ts

示例9: doFileOperation

    /**
     * General method for performing the given operation (copy|move)
     *
     * @param action the action to perform (copy|move)
     * @param type type of the content (content|folder)
     * @param contentEntry the contentEntry which has to have the action performed on
     * @param permission permission which is needed to apply the action
     */
    private doFileOperation(action: string, type: string, contentEntry: MinimalNodeEntryEntity, permission?: string): Subject<string> {
        const observable: Subject<string> = new Subject<string>();

        if (this.contentService.hasPermission(contentEntry, permission)) {
            const data: ContentNodeSelectorComponentData = {
                title: `${action} ${contentEntry.name} to ...`,
                currentFolderId: contentEntry.parentId,
                rowFilter: this.rowFilter.bind(this, contentEntry.id),
                imageResolver: this.imageResolver.bind(this),
                select: new EventEmitter<MinimalNodeEntryEntity[]>()
            };

            this.dialog.open(ContentNodeSelectorComponent, { data, panelClass: 'adf-content-node-selector-dialog', width: '630px' });

            data.select.subscribe((selections: MinimalNodeEntryEntity[]) => {
                const selection = selections[0];
                this.documentListService[`${action}Node`].call(this.documentListService, contentEntry.id, selection.id)
                    .subscribe(
                        observable.next.bind(observable, `OPERATION.SUCCES.${type.toUpperCase()}.${action.toUpperCase()}`),
                        observable.error.bind(observable)
                    );
                this.dialog.closeAll();
            });

            return observable;
        } else {
            observable.error(new Error(JSON.stringify({ error: { statusCode: 403 } })));
            return observable;
        }
    }
開發者ID:gravitonian,項目名稱:alfresco-ng2-components,代碼行數:38,代碼來源:node-actions.service.ts

示例10:

 (response) => {
   this.changeHistoryDialogRef = this.dialog.open(ChangeHistoryComponent, { width: '60%',
     data: {
       title: context.page.title,
       data: response
     }
   });
 }
開發者ID:HiP-App,項目名稱:HiP-CmsAngularApp,代碼行數:8,代碼來源:edit-page.component.ts


注:本文中的@angular/material.MdDialog.open方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。