From: Kai Moritz Date: Thu, 18 Sep 2025 20:17:21 +0000 (+0200) Subject: refactor: renamed `app` to `app.component` -- ALIGN X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Ffrontend--angular-20.3.1;p=demos%2Fkafka%2Fchat refactor: renamed `app` to `app.component` -- ALIGN --- diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 3a1a2969..4ee913b4 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,21 +1,21 @@ import { TestBed } from '@angular/core/testing'; -import { App } from './app'; +import { AppComponent } from './app.component'; describe('App', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [App], + imports: [AppComponent], }).compileComponents(); }); it('should create the app', () => { - const fixture = TestBed.createComponent(App); + const fixture = TestBed.createComponent(AppComponent); const app = fixture.componentInstance; expect(app).toBeTruthy(); }); it('should render title', () => { - const fixture = TestBed.createComponent(App); + const fixture = TestBed.createComponent(AppComponent); 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 index 2075482b..76763c28 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -4,9 +4,9 @@ import { RouterOutlet } from '@angular/router'; @Component({ selector: 'app-root', imports: [RouterOutlet], - templateUrl: './app.html', - styleUrl: './app.less' + templateUrl: './app.component.html', + styleUrl: './app.component.less' }) -export class App { +export class AppComponent { protected readonly title = signal('chatroom-frontend'); } diff --git a/src/main.ts b/src/main.ts index 5df75f9c..35b00f34 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,6 @@ import { bootstrapApplication } from '@angular/platform-browser'; import { appConfig } from './app/app.config'; -import { App } from './app/app'; +import { AppComponent } from './app/app.component'; -bootstrapApplication(App, appConfig) +bootstrapApplication(AppComponent, appConfig) .catch((err) => console.error(err));