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


TypeScript projectable.isProjectable函數代碼示例

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


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

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

示例2:

 /**
  * Returns a view model associated with the identifiable projector element. Throws an error,
  * if the element is not mappable.
  *
  * @param element The projector element
  * @returns the view model from the projector element
  */
 public getViewModelFromProjectorElement<T extends BaseProjectableViewModel>(
     element: IdentifiableProjectorElement
 ): T {
     this.assertElementIsMappable(element);
     const viewModel = this.viewModelStore.get<T>(element.name, element.id);
     if (viewModel && !isProjectable(viewModel)) {
         console.error('The view model is not projectable', viewModel, element);
     }
     return viewModel;
 }
開發者ID:CatoTH,項目名稱:OpenSlides,代碼行數:17,代碼來源:projector.service.ts

示例3: getProjectorElement

 /**
  * Retusn the identifiable projector element from the given types of slides/elements/descriptors
  *
  * @param obj Something related to IdentifiableProjectorElement
  * @returns the identifiable projector element from obj.
  */
 private getProjectorElement(
     obj: Projectable | ProjectorElementBuildDeskriptor | IdentifiableProjectorElement
 ): IdentifiableProjectorElement {
     if (isProjectable(obj)) {
         return obj.getSlide(this.configService).getBasicProjectorElement({});
     } else if (isProjectorElementBuildDeskriptor(obj)) {
         return obj.getBasicProjectorElement({});
     } else {
         return obj;
     }
 }
開發者ID:CatoTH,項目名稱:OpenSlides,代碼行數:17,代碼來源:projector.service.ts


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