Skip to content

Commit

Permalink
Merge pull request #2304 from HemanthKona/stories/EMBCESSMOD-5540-fix…
Browse files Browse the repository at this point in the history
…-identify-needs-form

EMBCESSMOD-5540: Fix input form of indentity needs form component
  • Loading branch information
ytqsl authored Jun 6, 2024
2 parents 9559e52 + 1bde99a commit b3d28b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<br />
@if (step.stepName === 'Needs') {
@if (needsFormLoaded) {
<app-identify-needs [identifyNeedsForm]="form"></app-identify-needs>
<app-identify-needs [form]="form"></app-identify-needs>
}
} @else {
<app-component-wrapper [componentName]="step.component" [folderPath]="needsFolderPath">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ import { DialogContent } from 'src/app/core/model/dialog-content.model';
imports: [ReactiveFormsModule, MatCardModule, MatFormFieldModule, MatCheckboxModule, MatRadioModule]
})
export default class IdentifyNeedsComponent implements OnInit {
@Input() identifyNeedsForm: UntypedFormGroup = this.formCreationService.createNeedsForm();
_form: UntypedFormGroup;

@Input()
set form(form: UntypedFormGroup) {
this._form = form;
this.identifyNeedsForm = form;
}

identifyNeedsForm: UntypedFormGroup = this.formCreationService.createNeedsForm();
identifyNeedsForm$: Subscription;

constructor(
Expand All @@ -33,7 +41,7 @@ export default class IdentifyNeedsComponent implements OnInit {
) {}

ngOnInit(): void {
if (!this.identifyNeedsForm) {
if (!this._form) {
this.identifyNeedsForm$ = this.formCreationService.getIndentifyNeedsForm().subscribe((identifyNeedsForm) => {
this.identifyNeedsForm = identifyNeedsForm;
});
Expand Down

0 comments on commit b3d28b4

Please sign in to comment.