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


TypeScript dialog.MatDialog类代码示例

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


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

示例1: openAlert

 /**
  * params:
  * - config: IAlertConfig {
  *     message: string;
  *     title?: string;
  *     viewContainerRef?: ViewContainerRef;
  *     closeButton?: string;
  * }
  *
  * Opens an alert dialog with the provided config.
  * Returns an MatDialogRef<TdAlertDialogComponent> object.
  */
 public openAlert(config: IAlertConfig): MatDialogRef<TdAlertDialogComponent> {
   let dialogConfig: MatDialogConfig = this._createConfig(config);
   let dialogRef: MatDialogRef<TdAlertDialogComponent> =
     this._dialogService.open(TdAlertDialogComponent, dialogConfig);
   let alertDialogComponent: TdAlertDialogComponent = dialogRef.componentInstance;
   alertDialogComponent.title = config.title;
   alertDialogComponent.message = config.message;
   if (config.closeButton) {
     alertDialogComponent.closeButton = config.closeButton;
   }
   return dialogRef;
 }
开发者ID:Teradata,项目名称:covalent,代码行数:24,代码来源:dialog.service.ts

示例2: openConfirm

 /**
  * params:
  * - config: IConfirmConfig {
  *     message: string;
  *     title?: string;
  *     viewContainerRef?: ViewContainerRef;
  *     acceptButton?: string;
  *     cancelButton?: string;
  * }
  *
  * Opens a confirm dialog with the provided config.
  * Returns an MatDialogRef<TdConfirmDialogComponent> object.
  */
 public openConfirm(config: IConfirmConfig): MatDialogRef<TdConfirmDialogComponent> {
   let dialogConfig: MatDialogConfig = this._createConfig(config);
   let dialogRef: MatDialogRef<TdConfirmDialogComponent> =
     this._dialogService.open(TdConfirmDialogComponent, dialogConfig);
   let confirmDialogComponent: TdConfirmDialogComponent = dialogRef.componentInstance;
   confirmDialogComponent.title = config.title;
   confirmDialogComponent.message = config.message;
   if (config.acceptButton) {
     confirmDialogComponent.acceptButton = config.acceptButton;
   }
   if (config.cancelButton) {
     confirmDialogComponent.cancelButton = config.cancelButton;
   }
   return dialogRef;
 }
开发者ID:Teradata,项目名称:covalent,代码行数:28,代码来源:dialog.service.ts

示例3: openPrompt

 /**
  * params:
  * - config: IPromptConfig {
  *     message: string;
  *     title?: string;
  *     value?: string;
  *     viewContainerRef?: ViewContainerRef;
  *     acceptButton?: string;
  *     cancelButton?: string;
  * }
  *
  * Opens a prompt dialog with the provided config.
  * Returns an MatDialogRef<TdPromptDialogComponent> object.
  */
 public openPrompt(config: IPromptConfig): MatDialogRef<TdPromptDialogComponent> {
   let dialogConfig: MatDialogConfig = this._createConfig(config);
   let dialogRef: MatDialogRef<TdPromptDialogComponent> =
     this._dialogService.open(TdPromptDialogComponent, dialogConfig);
   let promptDialogComponent: TdPromptDialogComponent = dialogRef.componentInstance;
   promptDialogComponent.title = config.title;
   promptDialogComponent.message = config.message;
   promptDialogComponent.value = config.value;
   if (config.acceptButton) {
     promptDialogComponent.acceptButton = config.acceptButton;
   }
   if (config.cancelButton) {
     promptDialogComponent.cancelButton = config.cancelButton;
   }
   return dialogRef;
 }
开发者ID:Teradata,项目名称:covalent,代码行数:30,代码来源:dialog.service.ts

示例4: closeAll

 /**
  * Wrapper function over the closeAll() method in MatDialog.
  * Closes all of the currently-open dialogs.
  */
 public closeAll(): void {
   this._dialogService.closeAll();
 }
开发者ID:Teradata,项目名称:covalent,代码行数:7,代码来源:dialog.service.ts

示例5:

 /**
  * params:
  * - component: ComponentType<T>
  * - config: MatDialogConfig
  * Wrapper function over the open() method in MatDialog.
  * Opens a modal dialog containing the given component.
  */
 public open<T>(component: ComponentType<T>, config?: MatDialogConfig): MatDialogRef<T> {
   return this._dialogService.open(component, config);
 }
开发者ID:Teradata,项目名称:covalent,代码行数:10,代码来源:dialog.service.ts

示例6: openDialog

  openDialog() {
    const dialogRef = this.dialog.open(DialogContentExampleDialog);

    dialogRef.afterClosed().subscribe(result => {
      console.log(`Dialog result: ${result}`);
    });
  }
开发者ID:codef0rmer,项目名称:material2,代码行数:7,代码来源:dialog-content-example.ts

示例7: openDialog

  openDialog(): void {
    let dialogRef = this.dialog.open(ProjectEditDialogComponent, {
      width: '450px',
      height: '400px'
    });

    dialogRef.afterClosed().subscribe(result => {
      console.log('The edit project dialog was closed');
    });
  }
开发者ID:ciobancristi,项目名称:project-management-app,代码行数:10,代码来源:projects.component.ts

示例8: openVerifyDialog

  openVerifyDialog(candidate) {
    const candidateName = `${candidate.rank.abbreviation} ${candidate.lastName}, ${candidate.firstName}`;
    const verified = candidate.record.verified;
    let dialogRef = this.dialog.open(CandidateVerifyDialog, {
      width: '500px',
      data: { candidateName, verified }
    });

    dialogRef.afterClosed().subscribe(result => {
      if (result) {
        this.changeVerification(candidate);
      }
    });
  }
开发者ID:ArmyMusicOnline,项目名称:ami,代码行数:14,代码来源:candidate-list.component.ts

示例9: onRemove

 onRemove(record: Contact) {
   const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
     data: 'Are you sure you want to delete this record?'
   });
   dialogRef.afterClosed().subscribe(result => {
     if (result) {
       this.contactsService
         .remove(record._id)
         .subscribe(
           () => {
             this.refresh();
             this.snackBar.open('Record removed successfully!', 'X', {
               duration: 3000,
               verticalPosition: 'top',
               horizontalPosition: 'center'
             });
           },
           error => this.onError('Error while trying to delete the record.')
         );
     }
   });
 }
开发者ID:loiane,项目名称:angular-crud-mean,代码行数:22,代码来源:contacts.component.ts

示例10: openDialog

 openDialog() {
   this.dialog.open(DialogElementsExampleDialog);
 }
开发者ID:codef0rmer,项目名称:material2,代码行数:3,代码来源:dialog-elements-example.ts


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