title: How to update a value using forms and services on angular?
body: <p>I have some issue in updation of value using reactive forms and services?
  i found the problem. its in component --> updateData()-->that arguments..</p>
  
  <p>pls help me to clear this problem.. i dont know which argument i need to pass? 
  i found the problem. its in component --> updateData()-->that arguments..</p>
  
  <p>pls help me to clear this problem.. i dont know which argument i need to pass?</p>
  
  <p>HTML:</p>
  
  <pre><code> &lt;form [formGroup]="group"&gt;
          &lt;div&gt; &amp;nbsp;  &amp;nbsp; Id&lt;input formControlName="Id"/&gt;&lt;/div&gt;
          &lt;br&gt; 
        &lt;div&gt; &amp;nbsp;  &amp;nbsp; Name&lt;input formControlName="Name"/&gt;&lt;/div&gt;
        &lt;br&gt; 
       &lt;div&gt; &amp;nbsp;  &amp;nbsp; Title&lt;input formControlName="Title"/&gt;&lt;/div&gt;
        &lt;br&gt;
        &lt;div&gt; &amp;nbsp;  &amp;nbsp; Author&lt;input formControlName="Author"/&gt;&lt;/div&gt;
        &lt;br&gt;
      &lt;/form&gt;
      &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
      &lt;button (click)="updateData()"&gt;Update&lt;/button&gt; &amp;nbsp;
      &lt;div&gt;
      &lt;button (click)="listData()"&gt;List&lt;/button&gt;
      {{list | json}}
      &lt;/div&gt;
  </code></pre>
  
  <p>component.ts </p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { FormBuilder, FormGroup } from '@angular/forms';
  import { HttpClient } from '@angular/common/http';
  import { ControlService } from '../control.service';
  import { NgForOf } from '@angular/common';
  
  @Component({
    selector: 'app-forms',
    templateUrl: './forms.component.html',
    styleUrls: ['./forms.component.css']
  })
  export class FormsComponent implements OnInit {
  group:FormGroup;
  list;
  list1;
    constructor(private fb:FormBuilder, private service:ControlService) {
      this.group=this.fb.group({
        Id:[''],
        Name:[''],
        Title:[''],
        Author:[''],
      })
     }
  
  ngOnInit() {
  
    }
  listData(){
    this.service.userData().subscribe(res=&gt;{
      console.log("list data",res);
      this.list=res;
    },error=&gt;{
      console.log("error1",error);
    })
  }
  updateData(){
  this.service.updateUserData({group.Name:this.list}).subscribe(res=&gt;{
    console.log('update data',res);
    this.list1=res;
  },error=&gt;{
    console.log("error2",error);
  })
  }
  
  
  }
  </code></pre>
  
  <p>service </p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { HttpClient } from '@angular/common/http';
  
  @Injectable({
    providedIn: 'root'
  })
  export class ControlService {
  
    constructor(private http:HttpClient) {}
  userData(){
   return this.http.get('http://localhost:5000/user');
  }
  updateUserData(value){
    return this.http.put('http://localhost:5000/user/2',value);
   }
  
  }
  </code></pre>