File

libs/nx/src/executors/shared/metadata-utils/__test/example-library/src/other/get-form-nested-form-group-typed.ts

Extends

AbstractBuildingBlock

Index

Properties
Methods

Properties

formGroup
Default value : this.buildFormGroup()

Methods

createExpertPropertyFormGroup
createExpertPropertyFormGroup()
Returns : FormGroupTyped<MyCustomForm>
getForm
getForm()
Returns : any
import { FormGroupTyped } from '@allianz/taly-common';
import { AbstractBuildingBlock } from '@allianz/taly-core';
import { FormControl, FormGroup } from '@angular/forms';

interface MyCustomForm {
  aFormControl: string;
}

export class GetFormIncorrectNestedFormGroupTyped extends AbstractBuildingBlock {
  formGroup = this.buildFormGroup();

  override getForm() {
    return this.formGroup;
  }

  private buildFormGroup() {
    return new FormGroup({
      aFormGroupTyped: this.createExpertPropertyFormGroup(),
      aPlainOldFormControl: new FormControl('')
    });
  }

  createExpertPropertyFormGroup() {
    const form = new FormGroup({
      aFormControl: new FormControl(`test`)
    });

    return form as FormGroupTyped<MyCustomForm>;
  }
}

results matching ""

    No results matching ""