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


TypeScript material.MatDialog類代碼示例

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


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

示例1: SetupDialog

	private SetupDialog(data,ref:ViewContainerRef, userData:any = null, conf = new MatDialogConfig()) {
		conf.viewContainerRef = ref;
		if(userData)
			conf.data = userData
		var resp = this.mdDialog.open(data,conf);
		return resp.afterClosed();
	}
開發者ID:mhear22,項目名稱:Angular,代碼行數:7,代碼來源:DialogService.ts

示例2: showQrCode

  showQrCode(event: any, address: string) {
    event.stopPropagation();

    const config = new MatDialogConfig();
    config.data = { address };
    this.dialog.open(QrCodeComponent, config);
  }
開發者ID:skycoin,項目名稱:skycoin,代碼行數:7,代碼來源:outputs.component.ts

示例3: describe

describe('MediaWallQueryComponent', () => {
	let component: MediaWallQueryComponent;
	let dialog: MatDialog;
	beforeEach(() => {
		TestBed.configureTestingModule({
			imports: [
				RouterTestingModule,
				BrowserAnimationsModule,
				MatDialogModule,
				MatCheckboxModule,
				StoreModule.provideStore(fromRoot.reducer),
				FormsModule,
				ReactiveFormsModule
			],
			declarations: [
				MediaWallQueryComponent
			]
		});
		TestBed.overrideModule(BrowserDynamicTestingModule, {
		set: {
			entryComponents: [ MediaWallQueryComponent ]
		}
});
	});
	beforeEach(() => {
			dialog = TestBed.get(MatDialog);
			const dialogRef = dialog.open(MediaWallQueryComponent);

			component = dialogRef.componentInstance;
		});

	it('should create an instance', () => {
		expect(component).toBeTruthy();
	});
});
開發者ID:eddygta17,項目名稱:loklak_search,代碼行數:35,代碼來源:media-wall-query.component.spec.ts

示例4: openProjectDialogFor

 /**
  * Opens the projection dialog for the given projectable. After the user's choice,
  * the projectors will be updated.
  *
  * @param obj The projectable.
  */
 public async openProjectDialogFor(obj: Projectable | ProjectorElementBuildDeskriptor): Promise<void> {
     let descriptor: ProjectorElementBuildDeskriptor;
     if (isProjectable(obj)) {
         descriptor = obj.getSlide(this.configService);
     } else {
         descriptor = obj;
     }
     const dialogRef = this.dialog.open<
         ProjectionDialogComponent,
         ProjectorElementBuildDeskriptor,
         ProjectionDialogReturnType
     >(ProjectionDialogComponent, {
         maxHeight: '90vh',
         autoFocus: false,
         data: descriptor
     });
     const response = await dialogRef.afterClosed().toPromise();
     if (response) {
         const [action, projectors, projectorElement]: ProjectionDialogReturnType = response;
         if (action === 'project') {
             this.projectorService.projectOnMultiple(projectors, projectorElement);
         } else if (action === 'addToPreview') {
             projectors.forEach(projector => {
                 this.projectorService.addElementToPreview(projector, projectorElement);
             });
         }
     }
 }
開發者ID:CatoTH,項目名稱:OpenSlides,代碼行數:34,代碼來源:projection-dialog.service.ts

示例5: showFileDialog

 showFileDialog(mediaItem: IMediaItem): void {
   this.dialog.open(MediaShowItemComponent, {
     data: {
       mediaItem
     }
   });
 }
開發者ID:Meistercoach83,項目名稱:sfw,代碼行數:7,代碼來源:media-item.component.ts

示例6: showRemoveDialog

  showRemoveDialog(mediaItem: IMediaItem, mediaGallery: IMediaGallery): void {
    const dialogRef = this.dialog.open(DeleteConfirmDialogComponent, {
      hasBackdrop: true,
      panelClass: 'delete-dialog',
      data: {
        mediaItem: mediaItem,
        mediaGallery: mediaGallery
      }
    });

    dialogRef.afterClosed().subscribe((data: {
      removedMediaItem: IMediaItem,
      deleteFromFS: boolean
    }) => {
      if (data) {

        const tasks: any[] = [];

        if (data.deleteFromFS) {
          tasks.push(this.mediaItemService.removeMediaItem(this.mediaItem.id));
        }

        if (this.mediaGallery) {
          this.mediaGallery.assignedMediaItems.splice(this.mediaGallery.assignedMediaItems.indexOf(this.mediaItem.id), 1);
          tasks.push(this.mediaGalleryService.updateMediaGallery(this.mediaGallery));
        }

        Promise.all(tasks).then(
          () => this.alertService.showSnackBar('success', 'general.media.upload.file.deleted'),
          (error: any) => this.alertService.showSnackBar('error', error.message)
        ).catch((error: any) => this.alertService.showSnackBar('error', error.message));

      }
    });
  }
開發者ID:Meistercoach83,項目名稱:sfw,代碼行數:35,代碼來源:media-item.component.ts

示例7: delete

 delete(char: Character) {
   let dialogRef = this.dialog.open(CharacterDeleteModalComponent, {
     width: '75%',
     disableClose: false,
     data: char
   });
 }
開發者ID:wjones0,項目名稱:cow,代碼行數:7,代碼來源:characters.component.ts

示例8: openDialog

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

    dialogRef.afterClosed().subscribe(result => {
      console.log(`Dialog result: ${result}`);
    });
  }
開發者ID:Nodarii,項目名稱:material2,代碼行數:7,代碼來源:dialog-content-example.ts

示例9: composeDialog

    // -----------------------------------------------------------------------------------------------------
    // @ Public methods
    // -----------------------------------------------------------------------------------------------------

    /**
     * Compose dialog
     */
    composeDialog(): void
    {
        this.dialogRef = this._matDialog.open(MailComposeDialogComponent, {
            panelClass: 'mail-compose-dialog'
        });
        this.dialogRef.afterClosed()
            .subscribe(response => {
                if ( !response )
                {
                    return;
                }
                const actionType: string = response[0];
                const formData: FormGroup = response[1];
                switch ( actionType )
                {
                    /**
                     * Send
                     */
                    case 'send':
                        console.log('new Mail', formData.getRawValue());
                        break;
                    /**
                     * Delete
                     */
                    case 'delete':
                        console.log('delete Mail');
                        break;
                }
            });
    }
開發者ID:karthik12ui,項目名稱:fuse-angular-full,代碼行數:37,代碼來源:main-sidebar.component.ts

示例10: create

 create() {
   const dialog = this.dialog.open(RoleDialogComponent);
   dialog.componentInstance.initCreate();
   dialog.componentInstance.created.subscribe(createdRole => {
     this.roles.push(createdRole);
   });
 }
開發者ID:sergiocosus,項目名稱:ventamatic.frontend,代碼行數:7,代碼來源:roles.component.ts


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