File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import {
2- ExtraOptions ,
3- NoPreloading ,
2+ InMemoryScrollingOptions ,
43 Route ,
4+ RouterConfigOptions ,
55} from '@angular/router' ;
66
77import { NOTIFICATIONS_MODULE_PATH } from './admin/admin-routing-paths' ;
@@ -261,12 +261,10 @@ export const APP_ROUTES: Route[] = [
261261 ] ,
262262 } ,
263263] ;
264- export const APP_ROUTING_CONF : ExtraOptions = {
265- // enableTracing: true,
266- useHash : false ,
267- scrollPositionRestoration : 'enabled' ,
268- anchorScrolling : 'enabled' ,
269- initialNavigation : 'enabledBlocking' ,
270- preloadingStrategy : NoPreloading ,
264+ export const APP_ROUTING_CONF : RouterConfigOptions = {
271265 onSameUrlNavigation : 'reload' ,
272266} ;
267+ export const APP_ROUTING_SCROLL_CONF : InMemoryScrollingOptions = {
268+ scrollPositionRestoration : 'top' ,
269+ anchorScrolling : 'enabled' ,
270+ } ;
Original file line number Diff line number Diff line change @@ -10,7 +10,11 @@ import {
1010import { NgModule } from '@angular/core' ;
1111import { BrowserModule } from '@angular/platform-browser' ;
1212import {
13+ NoPreloading ,
1314 provideRouter ,
15+ withEnabledBlockingInitialNavigation ,
16+ withInMemoryScrolling ,
17+ withPreloading ,
1418 withRouterConfig ,
1519} from '@angular/router' ;
1620import { NgbModule } from '@ng-bootstrap/ng-bootstrap' ;
@@ -50,6 +54,7 @@ import {
5054import {
5155 APP_ROUTES ,
5256 APP_ROUTING_CONF ,
57+ APP_ROUTING_SCROLL_CONF ,
5358} from './app-routes' ;
5459import { BROWSE_BY_DECORATOR_MAP } from './browse-by/browse-by-switcher/browse-by-decorator' ;
5560import { AuthInterceptor } from './core/auth/auth.interceptor' ;
@@ -103,7 +108,13 @@ const IMPORTS = [
103108] ;
104109
105110const PROVIDERS = [
106- provideRouter ( APP_ROUTES , withRouterConfig ( APP_ROUTING_CONF ) ) ,
111+ provideRouter (
112+ APP_ROUTES ,
113+ withRouterConfig ( APP_ROUTING_CONF ) ,
114+ withInMemoryScrolling ( APP_ROUTING_SCROLL_CONF ) ,
115+ withEnabledBlockingInitialNavigation ( ) ,
116+ withPreloading ( NoPreloading ) ,
117+ ) ,
107118 {
108119 provide : APP_BASE_HREF ,
109120 useFactory : getBaseHref ,
You can’t perform that action at this time.
0 commit comments