I'm new to Angular. Actually, I'm trying to subscribe data from a service and that data, I'm passing to form control of mine from (example, it's like an edit form).
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormArray, FormControl } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { QuestionService } from '../shared/question.service';
@Component({
  selector: 'app-update-que',
  templateUrl: './update-que.component.html',
  styleUrls: ['./update-que.component.scss']
})
export class UpdateQueComponent implements OnInit {
  questionsTypes = ['Text Type', 'Multiple choice', 'Single Select'];
  selectedQuestionType: string = "";
  question: any = {};
  constructor(private route: ActivatedRoute, private router: Router,
    private qService: QuestionService, private fb: FormBuilder) { 
  }
  ngOnInit() {
      this.getQuebyid();
  }
  getQuebyid(){
    this.route.params.subscribe(params => {
      this.qService.editQue([params['id']]).subscribe(res =>{
        this.question = res;
      });
    });
  }
  editqueForm =  this.fb.group({
    user: [''],
    questioning: ['', Validators.required],
    questionType: ['', Validators.required],
    options: new FormArray([])
  })
  setValue(){
    this.editqueForm.setValue({user: this.question.user, questioning: this.question.questioning})
  }
}
If I use [(ngModule)] on my form field to set the value to my element it is working fine and showing a warning it'll be deprecated in Angular 7 version.
<textarea formControlName="questioning" [(ngModule)]="question.questioning" cols="70" rows="4"></textarea>
So, I set the values to my form control by doing below but the element is not showing those values.
setValue(){
   this.editqueForm.setValue({user: this.question.user, questioning: this.question.questioning})
}
Can anyone tell me how to set values to my reactive form?
 
     
     
     
     
     
     
     
    