title: Load route after data is set in Angular 4
body: <p>In my application, I have some data that is common throughout the application. 
  But the data is populated after the view loads.
  For example data such as user-settings, profile etc.
   I know we can use resolve for loading data before the view loads, but I cant add resolve to all the routes.
  So when a specific route is refreshed the data is not available or the response from the server comes after the view loads.</p>
  
  <p>How can this be done?</p>
  
  <p>Below is the sample code of what I'm trying to achieve.
  in App.Component.ts
  if the token exists then redirect to the requested page else redirect to login.</p>
  
  <pre><code>if (token)
  { 
     this.commonServ.loadAppData();
     this._router.navigate([(path == 'login' || path == '') ? 'test' : path]);                     
  }
  else
     this._router.navigate(['login']);
  </code></pre>
  
  <p>The load data method hits a few API's and loads data to models.</p>
  
  <p>for example:</p>
  
  <pre><code>public loadAppData() {
  
          this.getUserSettings().then(settings =&gt; {
              if (settings) {
                  //Do Something
              }
          }, error =&gt; {
  
              });
  
  
  
          this.setUserProfile().then(settings =&gt; {
            //Do something
  
          });
  
      }
  </code></pre>
  
  <p>The data from setUserProfile comes after the view has loaded.
  How can this be done?</p>
  
  <p>Thanks!</p>