projects/i-components/src/lib/pipes/controlFromControlTemplate.pipe.ts
Pipe for creating the control associated to a template model
Name | controlFromControlTemplate |
Pure | true |
transform | ||||||||||||
transform(value: ControlTemplate, itemModel: FrameworkElement)
|
||||||||||||
Parameters :
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);
}
}