angular4-material-table
Version:
Angular 4 table based on @angular/cdk table structure, to allow row insertion, edition, validation and deletion.
22 lines • 941 B
JavaScript
import { TableElementReactiveForms } from './table-element-reactive-forms';
import { TableElementTemplateDriven } from './table-element-template-driven';
var TableElementFactory = /** @class */ (function () {
function TableElementFactory() {
}
TableElementFactory.createTableElement = function (newElement) {
if (this.isValidatorDefined(newElement)) {
// Create reactive forms element here.
return new TableElementReactiveForms(newElement);
}
else {
// Default is the one without validator.
return new TableElementTemplateDriven(newElement);
}
};
TableElementFactory.isValidatorDefined = function (newElement) {
return newElement.validator != null && newElement.validator != undefined;
};
return TableElementFactory;
}());
export { TableElementFactory };
//# sourceMappingURL=table-element.factory.js.map