• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript dialog.MatDialog类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript dialog.MatDialogRef类代码示例发布时间:2022-05-28
下一篇:
TypeScript core.HasInitialized类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap