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


TypeScript MatDialog.open方法代碼示例

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


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

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

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

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

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

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

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

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

示例8: openDialog

 openDialog() {
   this.dialog.open(DialogElementsExampleDialog);
 }
開發者ID:codef0rmer,項目名稱:material2,代碼行數:3,代碼來源:dialog-elements-example.ts

示例9:

 /**
  * 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

示例10: onDetails

 onDetails(record: Contact) {
   this.dialog.open(ContactsDialogComponent, {
     data: record
   });
 }
開發者ID:loiane,項目名稱:angular-crud-mean,代碼行數:5,代碼來源:contacts.component.ts


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