File

projects/i-components/src/lib/pipes/controlFromControlTemplate.pipe.ts

Description

Pipe for creating the control associated to a template model

Metadata

Name controlFromControlTemplate
Pure true

Methods

transform
transform(value: ControlTemplate, itemModel: FrameworkElement)
Parameters :
Name Type Optional Default value
value ControlTemplate No
itemModel FrameworkElement No null
Returns : any
import { Pipe, PipeTransform } from '@angular/core';
import { ControlTemplate, FrameworkElement } from '@mobilize/wms-framework';

/**
 *  Pipe for creating the control associated to a template model
 *
 * @export
 * @class ControlFromControlTemplatePipe
 * @implements {PipeTransform}
 */
@Pipe({
  name: 'controlFromControlTemplate',
  pure: true,
})
export class ControlFromControlTemplatePipe implements PipeTransform {
  transform(value: ControlTemplate, itemModel: FrameworkElement = null): any {
    return new value.templateModelClass(itemModel, value.declaringContext);
  }
}

result-matching ""

    No results matching ""