title: How to set value to form control in Reactive Forms in Angular
body: <p>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).</p>
  <pre class="lang-js prettyprint-override"><code>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 = &quot;&quot;;
    question: any = {};
  
    constructor(private route: ActivatedRoute, private router: Router,
      private qService: QuestionService, private fb: FormBuilder) { 
  
    }
  
    ngOnInit() {
        this.getQuebyid();
    }
  
    getQuebyid(){
      this.route.params.subscribe(params =&gt; {
        this.qService.editQue([params['id']]).subscribe(res =&gt;{
          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})
    }
  
  }
  </code></pre>
  <p>If I use <code>[(ngModule)]</code> 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.</p>
  <pre class="lang-html prettyprint-override"><code>&lt;textarea formControlName=&quot;questioning&quot; [(ngModule)]=&quot;question.questioning&quot; cols=&quot;70&quot; rows=&quot;4&quot;&gt;&lt;/textarea&gt;
  </code></pre>
  <p>So, I set the values to my form control by doing below but the element is not showing those values.</p>
  <pre class="lang-js prettyprint-override"><code>setValue(){
     this.editqueForm.setValue({user: this.question.user, questioning: this.question.questioning})
  }
  </code></pre>
  <p>Can anyone tell me how to set values to my reactive form?</p>