首页 > 解决方案 > A problem with push function in angular, how to format the form group before push?

问题描述

This is my function in which I am saving form group into an array and I am getting this error:

ERROR TypeError: control.setParent is not a function

My code:

saveInvolvedParty(){
    if( this.From_type=='') {
        this.toaster.warning("Plase select InvolvedParty Type")
    }
    else {
        let parti:any=this.transactionControl.controls.involvedParties
        parti.push('tparty',this.involvedParty) 
        console.log('control...',parti);
        console.log('control...',this.transactionControl);
        this.sendInvolvedPartyToList.emit(this.tparty)
    }

标签: angular

解决方案


推荐阅读