diff --git a/npm/ng-packs/packages/theme-basic/src/lib/constants/styles.ts b/npm/ng-packs/packages/theme-basic/src/lib/constants/styles.ts new file mode 100644 index 0000000000..5b4e7f483a --- /dev/null +++ b/npm/ng-packs/packages/theme-basic/src/lib/constants/styles.ts @@ -0,0 +1,9 @@ +export default ` +.content-header-title { + font-size: 24px; +} + +.entry-row { + margin-bottom: 15px; +} +`; \ No newline at end of file diff --git a/npm/ng-packs/packages/theme-basic/src/lib/services/initial.service.ts b/npm/ng-packs/packages/theme-basic/src/lib/services/initial.service.ts new file mode 100644 index 0000000000..35442a4d25 --- /dev/null +++ b/npm/ng-packs/packages/theme-basic/src/lib/services/initial.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Router } from '@angular/router'; +import { LazyLoadService } from '@abp/ng.core'; +import styles from '../constants/styles'; + +@Injectable({ providedIn: 'root' }) +export class InitialService { + constructor( + private router: Router, + private lazyLoadService: LazyLoadService, + ) { + this.appendStyle().subscribe(); + } + + appendStyle() { + return this.lazyLoadService.load(null, 'style', styles, 'head', 'afterbegin'); + } +} diff --git a/npm/ng-packs/packages/theme-basic/src/lib/theme-basic.module.ts b/npm/ng-packs/packages/theme-basic/src/lib/theme-basic.module.ts index 2fe5dabae4..263b48e7bd 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/theme-basic.module.ts +++ b/npm/ng-packs/packages/theme-basic/src/lib/theme-basic.module.ts @@ -10,6 +10,7 @@ import { ApplicationLayoutComponent } from './components/application-layout/appl import { EmptyLayoutComponent } from './components/empty-layout/empty-layout.component'; import { LayoutComponent } from './components/layout/layout.component'; import { LayoutState } from './states/layout.state'; +import { InitialService } from "./services/initial.service"; export const LAYOUTS = [ApplicationLayoutComponent, AccountLayoutComponent, EmptyLayoutComponent]; @@ -27,4 +28,6 @@ export const LAYOUTS = [ApplicationLayoutComponent, AccountLayoutComponent, Empt exports: [...LAYOUTS], entryComponents: [...LAYOUTS], }) -export class ThemeBasicModule {} +export class ThemeBasicModule { + constructor(private initialService: InitialService) {} +}