Skip to content

Commit

Permalink
refactor: improve webcomponent router initializer (onecx#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianjakobi committed Jul 24, 2024
1 parent 0453dd2 commit e5246a1
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Location } from '@angular/common'
import { Router } from '@angular/router'
import { AppStateService } from '@onecx/portal-integration-angular'
import { firstValueFrom, map } from 'rxjs'
Expand All @@ -12,7 +13,10 @@ export function initializeRouter(router: Router, appStateService: AppStateServic
route.data = {
...route.data,
mfeInfo: mfeInfo,
}
},
route.redirectTo = route.redirectTo && typeof route.redirectTo === 'string'
? Location.joinWithSlash(mfeInfo.baseHref, route.redirectTo)
: route.redirectTo
})
routes.push({
path: '**',
Expand Down

0 comments on commit e5246a1

Please sign in to comment.