2017-07-20 4 views

Antwort

3

Sie haben einen einfachen Fehler, entfernen Sie das letzte controls von Ihrem addChild():

addChild(i: number) { 
    const control = 
     //remove the last 'controls' 
     this.searchform.controls.rooms).controls[i]).controls["children"].controls; 
    control.push(this.initAge()); 
} 

und statt:

addChild(i: number) { 
    const control = 
     this.searchform.controls.rooms).controls[i]).controls["children"]; 
    control.push(this.initAge()); 
} 

Hier ist Ihr gegabelt Plunker: https://plnkr.co/edit/SmnjBroGHufori1PWNSR?p=preview