Loading config before starting to construct/load rootPage
<p>Im building a ionic 2 rc0 app. My rootPage depends on some configuration I have to load before I start my App. I'm using a provider called <strong>Config</strong> all over over the application. How can I delay/wait until configs loaded before constructing my <strong>Home</strong> page component. I need the configs in the constructor of Home. Is there sth. like a preloading module from ionic for situation like that ?</p>

<p>Is that even the best location for tasks like that ? </p>

<p>My Config module uses</p>

<p><code>http.get(../assets/config/config.json)
 .toPromise()
 .then(res =&gt; this.data = res);</code></p>

<p>to load the json file locally into data object of of my Config provider. And my code in <strong>app.component.ts</strong> fires a the function config.loadDefault() to load these default settings from the <strong>config.json</strong> file for the application .....</p>

<p><strong>app.components.ts</strong></p>

<pre><code>import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar } from 'ionic-native';

import { Home } from '../pages/home/home';
import { Config } from '../providers/config/config';

@Component({
  template: `&lt;ion-nav [root]="rootPage"&gt;&lt;/ion-nav&gt;`
})
export class LoddenApp {

  public rootPage = Home;

  constructor(
    public platform : Platform,
    public config   : Config
  ){
    // loading config
    config.loadDefault()
      .then(data =&gt; {
        console.log(data);
        return config.loadSettingsFromDB();
      })
      .catch(err =&gt; {
        console.log("error occured while loading config:");
        console.log(err);
      });


    platform.ready().then(() =&gt; {
    ...
    });
  }
}
</code></pre>