How we can create dynamic multiple form builder in Angular

28 Views Asked by At
let addUserFrom = fb.group({
  userGroup: fb.group({
    name: ['', Validators.required], 
    email: ['', Validators.required], 
    phone: ['', Validators.required]
  }),
  addressGroup: fb.group({
    street: ['', Validators.required], 
    suite: ['', Validators.required], 
    city: ['', Validators.required],
    zipCode: ['', Validators.required]
  })
});

Instead of creating fixed form controls and groups how I can create dynamic form group and controls like above format?

I tried multiple times to debug and searching but couldn't find anywhere.

0

There are 0 best solutions below