5

Hello All I have a Formarray which which has set of Roles. During Edit it dynamically removes & adds roles in that form array till here all works fine, but when i submit the form it thorws error & the page gets refresh.

Error : TypeError: Cannot read property 'updateOn' of null

Also I am attaching the screen shot belowenter image description here

2 Answers 2

10

it is worked for Me

Make sure you have put <button type="button" ></button> instead of <input type="submit" />

<button [ngClass]="(this.editMemberForm.invalid?'a1':'')" type="button" class="btn btn-success" (click)="saveData()">Save</button>
Sign up to request clarification or add additional context in comments.

Comments

0

Have a close look at what you're doing on your formGroup

For me doing some formGroup.removeControl("somefield");

raised the same error.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.