Question: I'm using the new router (not router-deprecated) in **Angular2 RC1**. I need to be able to load a JSON configuration file before the app continues loading. I'm using a Config class to grab my JSON configuration, but the problem is, I do not want the router-outlet to load until my configuration has completed loading.

I tried wrapping the `<router-outlet>` with an `*ngIf`, only to come across this issue: <https://github.com/angular/angular/issues/8539>

I also tried extending the `<router-outlet>`, per this [article](https://medium.com/@hasan.hameed/reading-configuration-files-in-angular-2-9d18b7a6aa4#.b0b1b5vv3), but with no luck (doesn't work with RC1)

Angular1 has a way to "reload" the route, but this doesn't seem to be present in NG2.

How can I do this? How can I load my JSON config file after the app has loaded, and the render the app after the configuration has finished? Has anyone else successfully done this?

Answer: 
In the new router (`>= RC.3`) <https://angular.io/docs/ts/latest/api/router/index/Router-interface.html#!#resetConfig-anchor> `resetConfig` can be used

> 
> 
> ```
> router.resetConfig([
>  { path: 'team/:id', component: TeamCmp, children: [
>    { path: 'simple', component: SimpleCmp },
>    { path: 'user/:name', component: UserCmp }
>  ] }
> ]);
> 
> ```
> 
> 

For your case I would initialize the router with some dummy route and dummy component, then after your JSON is available load new routes and navigate to the new default route.

<https://github.com/angular/angular/issues/11437#issuecomment-245995186> provides an **RC.6** Plunker
How about considering a loading page? That way, if your data isn't fully loaded yet, it shows a loading page instead of your route.

See [this question](https://stackoverflow.com/questions/35243443/pre-bootstrap-loading-screen-for-angular2) for suggestions on how to implement a loading screen in Angular2.

**Update:**

In the other hand, I just find out that we can pre load a data using a route resolver. I'm still learning about it too, and [this angular documentation](https://angular.io/guide/router#resolve-pre-fetching-component-data) might help.