Angular - Form Array push specific index

前端 未结 1 1441
北恋
北恋 2021-01-02 04:08
addStop() {
    const control = this.editForm.controls[\'stops\'];
    control.push(this.initStop());
}

I have this code to add a

相关标签:
1条回答
  • 2021-01-02 04:32

    Use FormArray#insert:

    control.insert(<position>, this.initStop());
    
    0 讨论(0)
提交回复
热议问题