From 7d13f6a223ef9722b7d22b91fc460206a6898921 Mon Sep 17 00:00:00 2001 From: cipchk Date: Mon, 24 Jul 2023 14:38:53 +0800 Subject: [PATCH] feat(cli): add `bindToComponentInputs` of `ng add` --- .../files/src/app/routes/routes-routing.module.ts | 1 + src/app/routes/routes.module.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/schematics/application/files/src/app/routes/routes-routing.module.ts b/schematics/application/files/src/app/routes/routes-routing.module.ts index c3abd4ab6..9ba26357b 100644 --- a/schematics/application/files/src/app/routes/routes-routing.module.ts +++ b/schematics/application/files/src/app/routes/routes-routing.module.ts @@ -60,6 +60,7 @@ const routes: Routes = [ // NOTICE: If you use `reuse-tab` component and turn on keepingScroll you can set to `disabled` // Pls refer to https://ng-alain.com/components/reuse-tab scrollPositionRestoration: 'top', + bindToComponentInputs: true } )], exports: [RouterModule], diff --git a/src/app/routes/routes.module.ts b/src/app/routes/routes.module.ts index f2ff41289..a1c1bae90 100644 --- a/src/app/routes/routes.module.ts +++ b/src/app/routes/routes.module.ts @@ -49,7 +49,10 @@ const routes: Route[] = [ ]; @NgModule({ - imports: [SharedModule, RouterModule.forRoot(routes, { scrollPositionRestoration: 'enabled' })], + imports: [ + SharedModule, + RouterModule.forRoot(routes, { scrollPositionRestoration: 'enabled', bindToComponentInputs: true }) + ], declarations: COMPONENTS }) export class RoutesModule {}