title: Initializing and accessing component properties directly from a service: Angular2
body: <p>I'm trying to persist some data even when the view (via routing) is changed and the component is destroyed from the DOM. The approach I'm taking is storing that data to a singleton service and store that data directly on the service, and when the component is recreated again I can re-assign the component properties from service. This reassigning is not working somehow. So my questions is, can I use those properties directly from the service? So instead of doing something like this when the component is created again:</p>
  
  <pre><code>ngOnInit() {
    this.var1 = this.someService.var1;
    console.log(this.var1);
  }
  </code></pre>
  
  <p>can I do,</p>
  
  <pre><code>someFunction {
    console.log(this.someService.var1);
  }
  </code></pre>
  
  <p>So here I'm not assigning the values from the service back the values in the component, but using the service values directly for reading and writing, and I'm thinking of accessing them directly in the template also. Is this a good practice?
  Also, for persisting the data, is there a reuse component routing strategy?</p>