title: Angular4 : Passing input value to service
body: <p>I am new to Angular 4.
  I have a variable "md_id" which is binded to the view as follows.</p>
  
  <p>HTML:</p>
  
  <pre><code>                    &lt;tr *ngFor="let item of driverData"&gt;
                          &lt;td class="align-right" id="md_id" [(ngModel)]="item.md_id" name="driverId" ngDefaultControl (click)="runPromo()"&gt;{{item.driver_name}}
                          &lt;/td&gt;
                      &lt;/tr&gt;
  </code></pre>
  
  <p>JSON:</p>
  
  <pre><code>[{"md_id": 1, "driver_name": "A"}, {"md_id": 2, "driver_name": "B"}, {"md_id": 3, "driver_name": "C"}, {"md_id": 4, "driver_name": "D"}]
  </code></pre>
  
  <p>I want that based on the value of md_id selected, it should pass that particular value of md_id to another service that can display the results accordingly based upon the selection.</p>
  
  <p>The selected value of md_id should be passed to the following service.</p>
  
  <p>Service:</p>
  
  <pre><code>public getName(md_id){
     return this.http.get(url+'/api/names?md_id='+md_id)
     .map((resService: Response) =&gt; resService.json())
      }
  </code></pre>
  
  <p>Component:</p>
  
  <pre><code> this.calendarService.getName(this.md_id).subscribe(data =&gt; this.promoName = data);
  </code></pre>
  
  <p>Could you please help me in knowing how can I pass the value of one service binded in the view to be passed into another service.</p>
  
  <p>Am I missing here something?</p>
  
  <p>Please help.</p>