jeudi 25 novembre 2021

I want to update mat-checkbox value in reactive form which are looped on Frontend using ngFor Angular 11

  1.                   </mat-checkbox>
    
         </li>
    

/typescript/ this.service.getCurrentData(this.router.snapshot.params.id).subscribe( (result)=>{ console.info('result is',result); this.camera.controls['camId'].setValue(result['camId']) this.camera.controls['ipAdress'].setValue(result['ipAdress']) this.camera.controls['userName'].setValue(result['userName']) this.camera.controls['password'].setValue(result['password'])

       for(var i = 0;i<this.Activity.length; i++){
        if( result.cameraActivity[i].featureId==this.Activity[i].activityFeatures[i].featureId)
        {
         
         this.activityfeature.patchValue(result['cameraActivity'][i].featureId);
          this.activityfeature.controls['featureId'].setValue(result['cameraActivity'][i].featureId)
        // this.activityfeature.controls['featureId'].setValue(result['cameraActivity'][i].featureId);
          console.log(result);
        }



Aucun commentaire:

Enregistrer un commentaire