How to use the @ng-dynamic-forms/core.DynamicFormArrayModel function in @ng-dynamic-forms/core

To help you get started, we’ve selected a few @ng-dynamic-forms/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DSpace / dspace-angular / src / app / submission / sections / upload / file / edit / section-upload-file-edit.component.ts View on Github external
const type = new DynamicSelectModel(accessConditionTypeModelConfig, BITSTREAM_FORM_ACCESS_CONDITION_TYPE_LAYOUT);
        const startDateConfig = Object.assign({}, BITSTREAM_FORM_ACCESS_CONDITION_START_DATE_CONFIG, confStart);
        const endDateConfig = Object.assign({}, BITSTREAM_FORM_ACCESS_CONDITION_END_DATE_CONFIG, confEnd);
        const groupsConfig = Object.assign({}, BITSTREAM_FORM_ACCESS_CONDITION_GROUPS_CONFIG, confGroup);

        const startDate = new DynamicDatePickerModel(startDateConfig, BITSTREAM_FORM_ACCESS_CONDITION_START_DATE_LAYOUT);
        const endDate = new DynamicDatePickerModel(endDateConfig, BITSTREAM_FORM_ACCESS_CONDITION_END_DATE_LAYOUT);
        const groups = new DynamicSelectModel(groupsConfig, BITSTREAM_FORM_ACCESS_CONDITION_GROUPS_LAYOUT);

        return [type, startDate, endDate, groups];
      };

      // Number of access conditions blocks in form
      accessConditionsArrayConfig.initialCount = isNotEmpty(this.fileData.accessConditions) ? this.fileData.accessConditions.length : 1;
      formModel.push(
        new DynamicFormArrayModel(accessConditionsArrayConfig, BITSTREAM_ACCESS_CONDITIONS_FORM_ARRAY_LAYOUT)
      );

    }
    this.initModelData(formModel);
    return formModel;
  }
github DSpace / dspace-angular / src / app / submission / section / upload / file / edit / file-edit.component.ts View on Github external
const type = new DynamicSelectModel(accessConditionTypeModelConfig, BITSTREAM_FORM_ACCESS_CONDITION_TYPE_LAYOUT);
        const startDateConfig = Object.assign({}, BITSTREAM_FORM_ACCESS_CONDITION_START_DATE_CONFIG, confStart);
        const endDateConfig = Object.assign({}, BITSTREAM_FORM_ACCESS_CONDITION_END_DATE_CONFIG, confEnd);
        const groupsConfig = Object.assign({}, BITSTREAM_FORM_ACCESS_CONDITION_GROUPS_CONFIG, confGroup);

        const startDate = new DynamicDatePickerModel(startDateConfig, BITSTREAM_FORM_ACCESS_CONDITION_START_DATE_LAYOUT);
        const endDate = new DynamicDatePickerModel(endDateConfig, BITSTREAM_FORM_ACCESS_CONDITION_END_DATE_LAYOUT);
        const groups = new DynamicSelectModel(groupsConfig, BITSTREAM_FORM_ACCESS_CONDITION_GROUPS_LAYOUT);

        return [ type, startDate, endDate, groups ];
      };

      // Number of access conditions blocks in form
      accessConditionsArrayConfig.initialCount = isNotEmpty(this.fileData.accessConditions) ? this.fileData.accessConditions.length : 1;
      formModel.push(
        new DynamicFormArrayModel(accessConditionsArrayConfig, BITSTREAM_ACCESS_CONDITIONS_FORM_ARRAY_LAYOUT)
      );

    }
    this.initModelData(formModel);
    return formModel;
  }
github DSpace / dspace-angular / src / app / submission / section / upload / files-edit / files-edit.component.ts View on Github external
const endDateConfig = Object.assign(BITSTREAM_FORM_ACCESS_CONDITION_END_DATE_CONFIG, confEnd);
        const groupsConfig = Object.assign(BITSTREAM_FORM_ACCESS_CONDITION_GROUPS_CONFIG, confGroup);

        const startDate = new DynamicDatePickerModel(startDateConfig, BITSTREAM_FORM_ACCESS_CONDITION_START_DATE_CLS);
        const endDate = new DynamicDatePickerModel(endDateConfig, BITSTREAM_FORM_ACCESS_CONDITION_END_DATE_CLS);
        const groups = new DynamicSelectModel(groupsConfig, BITSTREAM_FORM_ACCESS_CONDITION_GROUPS_CLS);
        return [type, startDate, endDate, groups];
      };

      //Number of access conditions blocks in form
      let repeat = this.fileData.accessConditions.length;
      repeat = (repeat == 0) ? 1 : repeat;

      for(let i=0; i
github DSpace / dspace-angular / src / app / shared / form / form.component.spec.ts View on Github external
label: 'Citation',
        placeholder: 'Citation',
      }
    ),

    new DynamicInputModel(
      {
        id: 'dc_identifier_issn',
        label: 'Identifiers',
        placeholder: 'Identifiers',
      }
    ),
  ];

  TEST_FORM_MODEL_WITH_ARRAY = [
    new DynamicFormArrayModel({

      id: 'bootstrapFormArray',
      initialCount: 1,
      label: 'Form Array',
      groupFactory: () => {
        return [
          new DynamicInputModel({

            id: 'bootstrapArrayGroupInput',
            placeholder: 'example array group input',
            readOnly: false
          })
        ];
      }
    })
  ];
github DSpace / dspace-angular / src / app / +admin / admin-registries / bitstream-formats / format-form / format-form.component.ts View on Github external
new DynamicSelectModel({
      id: 'supportLevel',
      name: 'supportLevel',
      options: this.supportLevelOptions,
      label: 'admin.registries.bitstream-formats.edit.supportLevel.label',
      hint: 'admin.registries.bitstream-formats.edit.supportLevel.hint',
      value: this.supportLevelOptions[0].value

    }),
    new DynamicCheckboxModel({
      id: 'internal',
      name: 'internal',
      label: 'Internal',
      hint: 'admin.registries.bitstream-formats.edit.internal.hint',
    }),
    new DynamicFormArrayModel({
      id: 'extensions',
      name: 'extensions',
      label: 'admin.registries.bitstream-formats.edit.extensions.label',
      groupFactory: () => [
        new DynamicInputModel({
          id: 'extension',
          placeholder: 'admin.registries.bitstream-formats.edit.extensions.placeholder',
        }, this.arrayInputElementLayout)
      ]
    }, this.arrayElementLayout),
  ];

  constructor(private dynamicFormService: DynamicFormService,
              private translateService: TranslateService,
              private router: Router) {