From: Kai Moritz Date: Wed, 17 Sep 2025 20:52:44 +0000 (+0200) Subject: refactor: renamed `app` to `app.component` -- MOVE X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=af7b96aa70a81231fe6f30a4080823553527e415;p=demos%2Fkafka%2Fchat refactor: renamed `app` to `app.component` -- MOVE --- diff --git a/src/app/app.component.html b/src/app/app.component.html new file mode 100644 index 00000000..75283724 --- /dev/null +++ b/src/app/app.component.html @@ -0,0 +1,342 @@ + + + + + + + + + + + +
+
+
+ +

Hello, {{ title() }}

+

Congratulations! Your app is running. 🎉

+
+ +
+
+ @for (item of [ + { title: 'Explore the Docs', link: 'https://angular.dev' }, + { title: 'Learn with Tutorials', link: 'https://angular.dev/tutorials' }, + { title: 'Prompt and best practices for AI', link: 'https://angular.dev/ai/develop-with-ai'}, + { title: 'CLI Docs', link: 'https://angular.dev/tools/cli' }, + { title: 'Angular Language Service', link: 'https://angular.dev/tools/language-service' }, + { title: 'Angular DevTools', link: 'https://angular.dev/tools/devtools' }, + ]; track item.title) { + + {{ item.title }} + + + + + } +
+ +
+
+
+ + + + + + + + + + + diff --git a/src/app/app.component.less b/src/app/app.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts new file mode 100644 index 00000000..3a1a2969 --- /dev/null +++ b/src/app/app.component.spec.ts @@ -0,0 +1,23 @@ +import { TestBed } from '@angular/core/testing'; +import { App } from './app'; + +describe('App', () => { + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [App], + }).compileComponents(); + }); + + it('should create the app', () => { + const fixture = TestBed.createComponent(App); + const app = fixture.componentInstance; + expect(app).toBeTruthy(); + }); + + it('should render title', () => { + const fixture = TestBed.createComponent(App); + fixture.detectChanges(); + const compiled = fixture.nativeElement as HTMLElement; + expect(compiled.querySelector('h1')?.textContent).toContain('Hello, chatroom-frontend'); + }); +}); diff --git a/src/app/app.component.ts b/src/app/app.component.ts new file mode 100644 index 00000000..2075482b --- /dev/null +++ b/src/app/app.component.ts @@ -0,0 +1,12 @@ +import { Component, signal } from '@angular/core'; +import { RouterOutlet } from '@angular/router'; + +@Component({ + selector: 'app-root', + imports: [RouterOutlet], + templateUrl: './app.html', + styleUrl: './app.less' +}) +export class App { + protected readonly title = signal('chatroom-frontend'); +} diff --git a/src/app/app.html b/src/app/app.html deleted file mode 100644 index 75283724..00000000 --- a/src/app/app.html +++ /dev/null @@ -1,342 +0,0 @@ - - - - - - - - - - - -
-
-
- -

Hello, {{ title() }}

-

Congratulations! Your app is running. 🎉

-
- -
-
- @for (item of [ - { title: 'Explore the Docs', link: 'https://angular.dev' }, - { title: 'Learn with Tutorials', link: 'https://angular.dev/tutorials' }, - { title: 'Prompt and best practices for AI', link: 'https://angular.dev/ai/develop-with-ai'}, - { title: 'CLI Docs', link: 'https://angular.dev/tools/cli' }, - { title: 'Angular Language Service', link: 'https://angular.dev/tools/language-service' }, - { title: 'Angular DevTools', link: 'https://angular.dev/tools/devtools' }, - ]; track item.title) { - - {{ item.title }} - - - - - } -
- -
-
-
- - - - - - - - - - - diff --git a/src/app/app.less b/src/app/app.less deleted file mode 100644 index e69de29b..00000000 diff --git a/src/app/app.spec.ts b/src/app/app.spec.ts deleted file mode 100644 index 3a1a2969..00000000 --- a/src/app/app.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { TestBed } from '@angular/core/testing'; -import { App } from './app'; - -describe('App', () => { - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [App], - }).compileComponents(); - }); - - it('should create the app', () => { - const fixture = TestBed.createComponent(App); - const app = fixture.componentInstance; - expect(app).toBeTruthy(); - }); - - it('should render title', () => { - const fixture = TestBed.createComponent(App); - fixture.detectChanges(); - const compiled = fixture.nativeElement as HTMLElement; - expect(compiled.querySelector('h1')?.textContent).toContain('Hello, chatroom-frontend'); - }); -}); diff --git a/src/app/app.ts b/src/app/app.ts deleted file mode 100644 index 2075482b..00000000 --- a/src/app/app.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Component, signal } from '@angular/core'; -import { RouterOutlet } from '@angular/router'; - -@Component({ - selector: 'app-root', - imports: [RouterOutlet], - templateUrl: './app.html', - styleUrl: './app.less' -}) -export class App { - protected readonly title = signal('chatroom-frontend'); -}