Skip to content

Commit

Permalink
[DURACOM-191] Provide routing option properly
Browse files Browse the repository at this point in the history
  • Loading branch information
atarix83 committed Mar 20, 2024
1 parent 8529257 commit 6704a39
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
16 changes: 7 additions & 9 deletions src/app/app-routes.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
ExtraOptions,
NoPreloading,
InMemoryScrollingOptions,
Route,
RouterConfigOptions,
} from '@angular/router';

import { NOTIFICATIONS_MODULE_PATH } from './admin/admin-routing-paths';
Expand Down Expand Up @@ -261,12 +261,10 @@ export const APP_ROUTES: Route[] = [
],
},
];
export const APP_ROUTING_CONF: ExtraOptions = {
// enableTracing: true,
useHash: false,
scrollPositionRestoration: 'enabled',
anchorScrolling: 'enabled',
initialNavigation: 'enabledBlocking',
preloadingStrategy: NoPreloading,
export const APP_ROUTING_CONF: RouterConfigOptions = {
onSameUrlNavigation: 'reload',
};
export const APP_ROUTING_SCROLL_CONF: InMemoryScrollingOptions = {
scrollPositionRestoration: 'top',
anchorScrolling: 'enabled',
};
13 changes: 12 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import {
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import {
NoPreloading,
provideRouter,
withEnabledBlockingInitialNavigation,
withInMemoryScrolling,
withPreloading,
withRouterConfig,
} from '@angular/router';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
Expand Down Expand Up @@ -50,6 +54,7 @@ import {
import {
APP_ROUTES,
APP_ROUTING_CONF,
APP_ROUTING_SCROLL_CONF,
} from './app-routes';
import { BROWSE_BY_DECORATOR_MAP } from './browse-by/browse-by-switcher/browse-by-decorator';
import { AuthInterceptor } from './core/auth/auth.interceptor';
Expand Down Expand Up @@ -103,7 +108,13 @@ const IMPORTS = [
];

const PROVIDERS = [
provideRouter(APP_ROUTES, withRouterConfig(APP_ROUTING_CONF)),
provideRouter(
APP_ROUTES,
withRouterConfig(APP_ROUTING_CONF),
withInMemoryScrolling(APP_ROUTING_SCROLL_CONF),
withEnabledBlockingInitialNavigation(),
withPreloading(NoPreloading),
),
{
provide: APP_BASE_HREF,
useFactory: getBaseHref,
Expand Down

0 comments on commit 6704a39

Please sign in to comment.