当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript material.MdDialog类代码示例

本文整理汇总了TypeScript中@angular/material.MdDialog的典型用法代码示例。如果您正苦于以下问题:TypeScript MdDialog类的具体用法?TypeScript MdDialog怎么用?TypeScript MdDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了MdDialog类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: open

  open(taskTimer: TaskTimer, viewContainerRef: ViewContainerRef): Observable<any> {
    const config = new MdDialogConfig();
    config.viewContainerRef = viewContainerRef;
    config.disableClose = true;

    const dialog = this.dialog.open(TaskTimerEditorComponent, config);

    dialog.componentInstance.initialize(taskTimer);

    return dialog.afterClosed();
  }
开发者ID:kensodemann,项目名称:time-trax,代码行数:11,代码来源:task-timer-editor.service.ts

示例2: open

  open(project: Project, viewContainerRef: ViewContainerRef): Observable<any> {
    const config = new MdDialogConfig();
    config.viewContainerRef = viewContainerRef;
    config.disableClose = true;

    const dialog = this.dialog.open(ProjectEditorComponent, config);

    dialog.componentInstance.initialize(project);

    return dialog.afterClosed();
  }
开发者ID:kensodemann,项目名称:time-trax,代码行数:11,代码来源:project-editor.service.ts

示例3: 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

示例4: reviewHistory

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

        dialogRef = this.dialog.open(ReviewHistoryDialog);

        return dialogRef.afterClosed();
    }
开发者ID:AdaCore,项目名称:gnatdashboard,代码行数:7,代码来源:dialog.service.ts

示例5: _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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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


注:本文中的@angular/material.MdDialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。