title: How to subscribe to changes on resolved route data - Angular 2
body: <p>I have a component that resolves data from a route when loaded.</p>
  
  <p>My challenge is, whenever the data being rendered by the component changes, the component doesn't get updated unless I refresh the page, or switch to another route and back.</p>
  
  <p>I understand this is because the data only gets resolved when the route is visited.</p>
  
  <p>Is there a way around this such that I can subscribe to changes on the resolved data ?</p>
  
  <p>Below are the relevant blocks of code.</p>
  
  <p><em>routes.ts</em></p>
  
  <pre><code>{
      path: 'user-information',
      component: UserInformationComponent,
      resolve: { userData: UserDataResolver }
  }
  </code></pre>
  
  <p><em>resolver.ts</em></p>
  
  <pre><code>@Injectable()
  export class UserDataResolver implements Resolve&lt;any&gt; {
  
    constructor(
      private userService: UserService
    ) {};
  
    resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable&lt;IUser&gt; {
     return this.userService.currentUser().first();
    };
  };
  </code></pre>
  
  <p><em>user.component.ts</em></p>
  
  <pre><code>loadUserData() {
    this.route.data.subscribe(
      data  =&gt; this.userData = data,
      error =&gt; this.updateForm.disable()
    );
  };
  </code></pre>