@@ -0,0 +1,37 @@
+// TESTS: Repeating Groups Of Fields in Single Mode ( 1 -> N arrays of containers for multiple fields )
+
+const model = {
+ repeating: [
+ {
+ a: 1,
+ b: 2,
+ },
+ a: 3,
+ b: 4,
+ }
+ ],
+ standard: 'YABBA DABBA DOOOOOO'
+};
+const meta = {
+ repeating: {
+ label: 'Repeating Group',
+ seed: { class: 'short-field' },
+ minRepeat: 1,
+ maxRepeat: 5,
+ initialRepeat: 3,
+ showAddControl: true,
+ showDeleteControl: true,
+ display: 'ALL', // ALL or SINGLE,
+ primaryField: 'a',
+ meta: [
+ a: { label: 'Field A' },
+ b: { label: 'Field B', type: 'select', options: [1, 2, 3, 4, 5] }
+ ]
+export { model, meta };
@@ -4,7 +4,7 @@
<h1>NgDynaform</h1>
<p>
Dynamic Form Layout Module<br>
- Load different tests by appending a query param to the URL <b>?test=N</b> (where N is a number between 1 and 13).<br>
+ Load different tests by appending a query param to the URL <b>?test=N</b> (where N is a number between 1 and 14).<br>
NOTE: Model set to update on change, but this can be set to blur or submit for less re-rendering.
</p>
</div>
@@ -39,7 +39,7 @@
<ng-container dynafield [control]="control" [meta]="meta" (call)="handleCallback($event)"></ng-container>
-
<ng-template #recursiveDynaform>
<div class="row pt-3">
<h3 class="col-sm-12" [ngClass]="'h-dyna-' + (path.length + 2)">{{ meta.label }}</h3>
@@ -15,10 +15,11 @@ import * as test10 from './_mock/testfields.v10';
import * as test11 from './_mock/testfields.v11';
import * as test12 from './_mock/testfields.v12';
import * as test13 from './_mock/testfields.v13';
+import * as test14 from './_mock/testfields.v14';
-const testdata = [ test1, test2, test3, test4, test5, test6, test7, test8, test9, test10, test11, test12, test13 ];
+const testdata = [ test1, test2, test3, test4, test5, test6, test7, test8, test9, test10, test11, test12, test13, test14 ];
-const defatltTest = 13;
+const defatltTest = 14;
@Component({
selector: 'app-root',
@@ -248,7 +248,7 @@ export class DynaformComponent implements OnInit {
private getContolKeysCSVFromMetadata(metadata): string {
// Return CSV of control keys in current nesting-level's metadata,
// excluding metadata points that don't create FormControls, FromGroups or FormArrays
- // (identified by their 'noFormControsl' flag)
+ // (identified by their 'noFormControl' flag)
// e.g. ButtonGroups, HTMLChunks, etc.
return Object.entries(metadata)
.filter(([key, val]) => !(val as StringMap<any>).noFormControls)