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


TypeScript MatDialog.open方法代码示例

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


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

示例1: editCourse

    editCourse({description, longDescription, category}:Course) {

        const dialogConfig = new MatDialogConfig();

        dialogConfig.disableClose = true;
        dialogConfig.autoFocus = true;

        dialogConfig.data = {
            description, longDescription, category
        };

        const dialogRef = this.dialog.open(CourseDialogComponent,
            dialogConfig);


        dialogRef.afterClosed().subscribe(
            val => console.log("Dialog output:", val)
        );

    }
开发者ID:mrplanktonlex,项目名称:angular-material-course,代码行数:20,代码来源:courses-card-list.component.ts

示例2: onCreateClientClicked

 public onCreateClientClicked(): void {
   let creationDialog = this.dialog.open(ClientCreationDialog);
   creationDialog
     .afterClosed()
     .subscribe(dialogResult => {
       if (!dialogResult) {
         return;
       }
   
       let creationResult = dialogResult.Result as ClientCreationResult;
       if (creationResult != ClientCreationResult.Success) {
         return;
       }
   
       let createdClient = dialogResult.client as Client;
       this.snackbar.open(`'${createdClient.name}' was created successfully`, "OK", {
         duration: 5000
       });
       this.clients.unshift(createdClient);
     });
 }
开发者ID:Machinarius,项目名称:GAPInsurance,代码行数:21,代码来源:dashboard.component.ts

示例3: verifyAction

    public verifyAction(confirmation: ConfirmSettings): Observable<ConfirmResponseTypes> {
        let result = new Subject<ConfirmResponseTypes>();

        confirmation.confirmText = confirmation.confirmText || "OK"
        confirmation.cancelText = confirmation.cancelText || "Cancel";

        let settings = {
            width: '500px',
            disableClose: true,
            hasBackdrop: true,
            data: confirmation
          };

        this.dialog.open(VerifyActionComponent, settings)
            .afterClosed().subscribe(response => {
                
                result.next(response);
        });

        return result.asObservable();
    }
开发者ID:grecosoft,项目名称:NetFusion,代码行数:21,代码来源:ConfirmationService.ts

示例4: open

 /**
  * Opens the dialog. Returns the chosen value after the user accepts.
  * @param title The title to display in the dialog
  * @param choices The available choices
  * @param multiSelect turn on the option to select multiple entries.
  *  The answer.items will then be an array.
  * @param actions optional strings for buttons replacing the regular confirmation.
  * The answer.action will reflect the button selected
  * @param clearChoice A string for an extra, visually slightly separated
  * choice for 'explicitly set an empty selection'. The answer's action may
  * have this string's value
  * @returns an answer {@link ChoiceAnswer}
  */
 public async open(
     title: string,
     choices: ChoiceDialogOptions,
     multiSelect: boolean = false,
     actions?: string[],
     clearChoice?: string
 ): Promise<ChoiceAnswer> {
     const dialogRef = this.dialog.open(ChoiceDialogComponent, {
         minWidth: '250px',
         maxHeight: '90vh',
         disableClose: true,
         data: {
             title: title,
             choices: choices,
             multiSelect: multiSelect,
             actionButtons: actions,
             clearChoice: clearChoice
         }
     });
     return dialogRef.afterClosed().toPromise();
 }
开发者ID:CatoTH,项目名称:OpenSlides,代码行数:34,代码来源:choice.service.ts

示例5: onCreatePolicyClicked

 public onCreatePolicyClicked(): void {
   let creationDialog = this.dialog.open(PolicyCreationDialog);
   creationDialog
     .afterClosed()
     .subscribe(dialogResult => {
       if (!dialogResult) {
         return;
       }
   
       let creationResult = dialogResult.result as PolicyCreationResult;
       if (creationResult != PolicyCreationResult.Success) {
         return;
       }
   
       let createdPolicy = dialogResult.policy as Policy;
       this.snackbar.open(`"${createdPolicy.name}" was created successfully`, "OK", {
         duration: 5000
       });
       this.policies.unshift(createdPolicy);
     });
 }
开发者ID:Machinarius,项目名称:GAPInsurance,代码行数:21,代码来源:dashboard.component.ts

示例6: openDialog

  openDialog(offre, id) {
  
    const dialogRef = this.dialog.open(DialogComponent, {
      //height: '350px',
      width: '400px'
    });

/*
    dialogRef.afterClosed().subscribe(result => {
      if (result) {
        this.apiService.postOffre(offre, id)
          .subscribe(res => {
            this.maj();
          }, (err) => {
            console.log(err);
          });
        
      //} else {
        //console.log("Envoie refusĂŠ.");
      //}
    });*/
  }
开发者ID:Dardym,项目名称:RepriseOrdi,代码行数:22,代码来源:client-liste.component.ts

示例7: dropFiles

 dropFiles(): Observable<DropFilesAction> {
   return this.dialog.open(DropFilesDialogComponent, new MatDialogConfig()).afterClosed();
 }
开发者ID:arpitsaan,项目名称:ShapeShifter,代码行数:3,代码来源:dialog.service.ts

示例8: confirm

 confirm(title: string, message: string): Observable<boolean> {
   const config = new MatDialogConfig();
   config.data = { title, message };
   return this.dialog.open(ConfirmDialogComponent, config).afterClosed();
 }
开发者ID:arpitsaan,项目名称:ShapeShifter,代码行数:5,代码来源:dialog.service.ts

示例9: pickDemo

 pickDemo(): Observable<DemoInfo> {
   return this.dialog.open(DemoDialogComponent, new MatDialogConfig()).afterClosed();
 }
开发者ID:arpitsaan,项目名称:ShapeShifter,代码行数:3,代码来源:dialog.service.ts

示例10: openModal

 /**
  * Open change password modal
  */
 openModal(id: string): void {
     let dialogRef = this.dialog.open(ModalChangePasswordComponent, {
         data: {}
     });
 }
开发者ID:cdavidsp,项目名称:Academico,代码行数:8,代码来源:profile.component.ts


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