|
@@ -5,8 +5,8 @@
|
|
|
* -------
|
|
|
* autoMeta(model) - generate basic metadata from a raw or mapped model, recursively if necessary
|
|
|
* combineExtraMeta(metadata, extraMeta) - combine extra metadata into metatdata, lazyly and recursively
|
|
|
- * combineModelWithMeta(model, extraMeta) - automatically generated metadata for model then combines extra metadata
|
|
|
- * buildFieldSpecificMeta(metadata) - use field metadata models to expand metadata
|
|
|
+ * combineModelWithMeta(model, extraMeta) - automatically generate metadata from model then combine extra metadata
|
|
|
+ * buildFieldSpecificMeta(metadata) - use field-type-specific metadata models to expand metadata
|
|
|
* buildFormGroupFunctionFactory(fb) - return a function to buildFormGroups using the supplied FormBuilder singleton
|
|
|
*
|
|
|
* Variable names
|
|
@@ -22,7 +22,7 @@ import { reduce } from 'lodash/fp';
|
|
|
import * as fmdModels from './../models';
|
|
|
|
|
|
// REMINDER: Import this directly from @angular/forms when we upgrade to Angular 6
|
|
|
-// While we're still' on Angular 5 just declare it
|
|
|
+// While we're still on Angular 5 just declare it
|
|
|
interface AbstractControlOptions {
|
|
|
validators?: ValidatorFn | ValidatorFn[] | null
|
|
|
asyncValidators?: AsyncValidatorFn | AsyncValidatorFn[] | null
|
|
@@ -113,7 +113,6 @@ const buildFormGroupFunctionFactory = (fb: FormBuilder): (meta) => FormGroup =>
|
|
|
// ( it's done this way so we can use the FormBuilder singleton without reinitialising )
|
|
|
|
|
|
// Build Form Control
|
|
|
- // TODO: Flesh out function to build validators
|
|
|
const buildControlState = metaF => ({ value: metaF.value || metaF.default, disabled: metaF.isDisabled });
|
|
|
const buildValidators = (metaF): AbstractControlOptions => ({
|
|
|
validators: metaF.validators,
|