当前位置: 首页>>代码示例>>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;未经允许,请勿转载。