From b3f423e7dc7cd432f1e83746d3280a88e6568c17 Mon Sep 17 00:00:00 2001 From: splincode Date: Fri, 26 Jan 2024 12:24:56 +0300 Subject: [PATCH] chore(demo): set changelog page as standalone --- projects/demo/src/modules/app/app.routes.ts | 3 +-- .../info/changelog/changelog.component.ts | 6 +++++- .../modules/info/changelog/changelog.module.ts | 18 ------------------ 3 files changed, 6 insertions(+), 21 deletions(-) delete mode 100644 projects/demo/src/modules/info/changelog/changelog.module.ts diff --git a/projects/demo/src/modules/app/app.routes.ts b/projects/demo/src/modules/app/app.routes.ts index 3bcca115936d..c6e0709e5cd0 100644 --- a/projects/demo/src/modules/app/app.routes.ts +++ b/projects/demo/src/modules/app/app.routes.ts @@ -28,8 +28,7 @@ export const ROUTES: Routes = [ }, { path: 'changelog', - loadChildren: async () => - (await import('../info/changelog/changelog.module')).ChangelogModule, + loadComponent: async () => import('../info/changelog/changelog.component'), data: { title: 'Changelog', }, diff --git a/projects/demo/src/modules/info/changelog/changelog.component.ts b/projects/demo/src/modules/info/changelog/changelog.component.ts index 9bfa888be54a..96f6c9a472a6 100644 --- a/projects/demo/src/modules/info/changelog/changelog.component.ts +++ b/projects/demo/src/modules/info/changelog/changelog.component.ts @@ -1,11 +1,15 @@ +import {AsyncPipe} from '@angular/common'; import {ChangeDetectionStrategy, Component} from '@angular/core'; +import {TuiDocPageModule, TuiMarkdownPipe} from '@taiga-ui/addon-doc'; @Component({ + standalone: true, selector: 'changelog', + imports: [TuiDocPageModule, TuiMarkdownPipe, AsyncPipe], templateUrl: './changelog.template.html', styleUrls: ['./changelog.component.less'], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class ChangelogComponent { +export default class ChangelogComponent { readonly changelog = import('../../../../../../CHANGELOG.md?raw'); } diff --git a/projects/demo/src/modules/info/changelog/changelog.module.ts b/projects/demo/src/modules/info/changelog/changelog.module.ts deleted file mode 100644 index f459bfc9cb63..000000000000 --- a/projects/demo/src/modules/info/changelog/changelog.module.ts +++ /dev/null @@ -1,18 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes, TuiMarkdownPipe} from '@taiga-ui/addon-doc'; - -import {ChangelogComponent} from './changelog.component'; - -@NgModule({ - imports: [ - CommonModule, - TuiAddonDocModule, - TuiMarkdownPipe, - RouterModule.forChild(tuiGenerateRoutes(ChangelogComponent)), - ], - declarations: [ChangelogComponent], - exports: [ChangelogComponent], -}) -export class ChangelogModule {}