title: How to set input model value from service in Angular?
body: <p>Here issue is how to set the input model value from a service in Angular 2.</p>
  
  <p>Here is my sample code:<br>
  component:</p>
  
  <pre><code>//our root app component
  import {Component} from 'angular2/core'
  import {Service} from './service'
  
  @Component({
    selector: 'my-directive',
    providers: [],
    template: `&lt;input [(ngModel)]="abc"&gt;`,
    directives: []
  })
  export class Directive {
    constructor(public service: Service) {
      this.abc = this.service.value;
    }
  }
  </code></pre>
  
  <p>service:</p>
  
  <p>//our root app component
  import {Injectable} from 'angular2/core'</p>
  
  <pre><code>@Injectable()
  export class Service {
    constructor() {
      this.value = "service"
    }
    abcFun(){
      // need to update value from here
    }
  }
  </code></pre>
  
  <p><a href="http://plnkr.co/edit/adrY21aYmTQOLLa7yCp0?p=info" rel="nofollow noreferrer">plunkr here</a></p>