From 755ad92a960cf4b0bbda6cb743b433d1af0609be Mon Sep 17 00:00:00 2001 From: Roch Nicolas <89575880+tomodasheesh@users.noreply.github.com> Date: Mon, 1 Jul 2024 17:43:54 +0800 Subject: [PATCH] Add DxHttpModule to Angular app template (#894) * Import DxHttpModule * Add http module test --------- Co-authored-by: Rochmar Nicolas (DevExpress) --- packages/devextreme-schematics/src/add-layout/index.ts | 1 + packages/devextreme-schematics/src/add-layout/index_spec.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/devextreme-schematics/src/add-layout/index.ts b/packages/devextreme-schematics/src/add-layout/index.ts index a16c63e9d..316f22237 100644 --- a/packages/devextreme-schematics/src/add-layout/index.ts +++ b/packages/devextreme-schematics/src/add-layout/index.ts @@ -181,6 +181,7 @@ function updateAppModule(host: Tree, sourcePath: string) { }; const rules = [ + modifyFileRule(appModulePath, importSetter('DxHttpModule', 'devextreme-angular/http')), modifyFileRule(appModulePath, importSetter('SideNavOuterToolbarModule', './layouts')), modifyFileRule(appModulePath, importSetter('SideNavInnerToolbarModule', './layouts')), modifyFileRule(appModulePath, importSetter('SingleCardModule', './layouts')), diff --git a/packages/devextreme-schematics/src/add-layout/index_spec.ts b/packages/devextreme-schematics/src/add-layout/index_spec.ts index 2bc6d2a33..b0a31ef7f 100644 --- a/packages/devextreme-schematics/src/add-layout/index_spec.ts +++ b/packages/devextreme-schematics/src/add-layout/index_spec.ts @@ -99,6 +99,7 @@ describe('layout', () => { expect(styles[2]).toBe('src/themes/generated/theme.additional.css'); const moduleContent = tree.readContent('/src/app/app.module.ts'); + expect(moduleContent).toContain('import { DxHttpModule }'); expect(moduleContent) .toContain('import { SideNavOuterToolbarModule, SideNavInnerToolbarModule, SingleCardModule }'); expect(moduleContent)