From 455ded3909db6b95d66eb5547e75d2ce0a94b8c6 Mon Sep 17 00:00:00 2001 From: Stanslav Zaytsev Date: Mon, 11 Mar 2024 08:41:27 +0300 Subject: [PATCH] chore(demo): changed main app-bar example component to standalone, changed routing --- projects/demo/src/modules/app/app.routes.ts | 11 +++----- .../components/app-bar/app-bar.component.ts | 8 ++++-- .../components/app-bar/app-bar.module.ts | 27 ------------------- 3 files changed, 10 insertions(+), 36 deletions(-) delete mode 100644 projects/demo/src/modules/components/app-bar/app-bar.module.ts diff --git a/projects/demo/src/modules/app/app.routes.ts b/projects/demo/src/modules/app/app.routes.ts index ebb68a1574f4..f3151df8578c 100644 --- a/projects/demo/src/modules/app/app.routes.ts +++ b/projects/demo/src/modules/app/app.routes.ts @@ -1031,14 +1031,11 @@ export const ROUTES: Routes = [ title: 'Preview', }, }, - { + route({ path: 'navigation/app-bar', - loadChildren: async () => - (await import('../components/app-bar/app-bar.module')).ExampleTuiAppBarModule, - data: { - title: 'AppBar', - }, - }, + loadComponent: async () => import('../components/app-bar/app-bar.component'), + title: 'AppBar', + }), { path: 'navigation/tab-bar', loadChildren: async () => diff --git a/projects/demo/src/modules/components/app-bar/app-bar.component.ts b/projects/demo/src/modules/components/app-bar/app-bar.component.ts index 15be45825504..c765ee021a17 100644 --- a/projects/demo/src/modules/components/app-bar/app-bar.component.ts +++ b/projects/demo/src/modules/components/app-bar/app-bar.component.ts @@ -1,13 +1,17 @@ import {Component} from '@angular/core'; import {changeDetection} from '@demo/emulate/change-detection'; -import type {TuiDocExample} from '@taiga-ui/addon-doc'; +import {TuiAddonDocModule, type TuiDocExample} from '@taiga-ui/addon-doc'; + +import {TuiAppBarExample1} from './examples/1'; @Component({ + standalone: true, selector: 'example-tui-app-bar', + imports: [TuiAddonDocModule, TuiAppBarExample1], templateUrl: './app-bar.template.html', changeDetection, }) -export class ExampleTuiAppBarComponent { +export default class ExampleTuiAppBarComponent { protected readonly exampleModule = import('./examples/import/import-module.md?raw'); protected readonly exampleHtml = import('./examples/import/insert-template.md?raw'); diff --git a/projects/demo/src/modules/components/app-bar/app-bar.module.ts b/projects/demo/src/modules/components/app-bar/app-bar.module.ts deleted file mode 100644 index 43ed93d6f8d7..000000000000 --- a/projects/demo/src/modules/components/app-bar/app-bar.module.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {RouterModule} from '@angular/router'; -import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; -import {TuiAppBarModule} from '@taiga-ui/addon-mobile'; -import {TuiButtonModule, TuiLabelModule, TuiNotificationModule} from '@taiga-ui/core'; -import {TuiProgressModule} from '@taiga-ui/kit'; - -import {ExampleTuiAppBarComponent} from './app-bar.component'; -import {TuiAppBarExample1} from './examples/1'; - -@NgModule({ - imports: [ - CommonModule, - TuiButtonModule, - TuiProgressModule, - TuiLabelModule, - TuiNotificationModule, - TuiAppBarModule, - TuiAddonDocModule, - TuiAppBarExample1, - RouterModule.forChild(tuiGenerateRoutes(ExampleTuiAppBarComponent)), - ], - declarations: [ExampleTuiAppBarComponent], - exports: [ExampleTuiAppBarComponent], -}) -export class ExampleTuiAppBarModule {}