import { TableElementReactiveForms } from './table-element-reactive-forms' ; import { TableElementTemplateDriven } from './table-element-template-driven' ; export class TableElementFactory { public static createTableElement ( newElement ) { if ( this . isValidatorDefined ( newElement ) ) { return new TableElementReactiveForms ( newElement ) ; } else { return new TableElementTemplateDriven ( newElement ) ; } } static isValidatorDefined ( newElement ) { return newElement . validator != null && newElement . validator != undefined ; } }