I am having a problem with my angular2 router configuration Routes, which resolveruns twice, although it is defined only once.
Here is my definition Routes:
export const AppRoutes: Routes = [
{path: '', component: HomeComponent},
{
path: 'dashboard',
component: DashboardComponent,
children: [
{
path: '',
component: DashboardSummaryComponent,
resolve: {
userAccount: UserAccountResolve
}
},
...
When I go to the '/dashboard'following:
this.router.navigate(['/dashboard'])
The solution for DashboardSummaryComponent(i.e. UserAccountResolve) is executed twice ...
Can someone explain why? Is this to be expected?
edit 1 : It should be noted that UserAccountResolvethis is an http call . In addition, the first call (the one that fails) results in an error 401. (this does not seem to be relevant to the problem)
2. , , angular 2 , / ...