<FormArray>this.myForm.get(i) throwing error path.split is not a function


#1

I am trying to make a dynamic form

snipet

this.myForm= this.formBuilder.group({
        programmes: this.formBuilder.array([this.initProgramme(),]),
    });



initProgramme() {
        return this.formBuilder.group({
            tickets: this.formBuilder.array([this.initTicket(),])
        });
    }


initTicket() {
        return this.formBuilder.group({
            field1:''
        });
    }

adding dynamic programme works with this function

addProgToForm(){
    
    const control = <FormArray>this.myForm.get('programmes');
        control.push(this.initProgramme());
  }

adding ticket to programme THROWS ERROR

addTicket(programme: any) {
        const control = (<FormArray>this.myForm.get('programmes')).get(programme); // THROWS ERROR  HERE
         (<FormArray>control.get('tickets')).push(this.initTicket());
    }

Basically , at get(programme) it says path.split is not a function

How do I get access to tickets control ?

Thanks