Skip to content

Commit 2170bcf

Browse files
committed
3rd step migrate to standalone
2nd step had no changes
1 parent 79c21bb commit 2170bcf

File tree

4 files changed

+33
-60
lines changed

4 files changed

+33
-60
lines changed

webapp/src/app/app.component.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ describe('AppComponent', () => {
66
beforeEach(async () => {
77
await TestBed.configureTestingModule({
88
imports: [
9-
RouterTestingModule
9+
RouterTestingModule,
10+
AppComponent
1011
],
11-
declarations: [AppComponent],
1212
}).compileComponents();
1313
});
1414

webapp/src/app/app.component.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import { Component } from '@angular/core';
2+
import { NavbarComponent } from './components/navbar/navbar.component';
3+
import { RouterOutlet } from '@angular/router';
24

35
@Component({
4-
selector: 'app-root',
5-
templateUrl: './app.component.html',
6-
styleUrls: ['./app.component.scss']
6+
selector: 'app-root',
7+
templateUrl: './app.component.html',
8+
styleUrls: ['./app.component.scss'],
9+
standalone: true,
10+
imports: [NavbarComponent, RouterOutlet]
711
})
812
export class AppComponent {
913
title = 'webapp';

webapp/src/app/app.module.ts

-52
This file was deleted.

webapp/src/main.ts

+24-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
1-
import { enableProdMode } from '@angular/core';
1+
import { enableProdMode, importProvidersFrom } from '@angular/core';
22
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
33

4-
import { AppModule } from './app/app.module';
4+
55
import { environment } from './environments/environment';
6+
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
7+
import { BrowserModule, bootstrapApplication } from '@angular/platform-browser';
8+
import { AppRoutingModule } from './app/app-routing.module';
9+
import { provideAnimations } from '@angular/platform-browser/animations';
10+
import { ReactiveFormsModule } from '@angular/forms';
11+
import { MatButtonModule } from '@angular/material/button';
12+
import { MatCardModule } from '@angular/material/card';
13+
import { MatIconModule } from '@angular/material/icon';
14+
import { MatToolbarModule } from '@angular/material/toolbar';
15+
import { MatListModule } from '@angular/material/list';
16+
import { MatInputModule } from '@angular/material/input';
17+
import { MatFormFieldModule } from '@angular/material/form-field';
18+
import { MatDialogModule } from '@angular/material/dialog';
19+
import { MatStepperModule } from '@angular/material/stepper';
20+
import { AppComponent } from './app/app.component';
621

722
if (environment.production) {
823
enableProdMode();
924
}
1025

11-
platformBrowserDynamic().bootstrapModule(AppModule)
26+
bootstrapApplication(AppComponent, {
27+
providers: [
28+
importProvidersFrom(BrowserModule, AppRoutingModule, ReactiveFormsModule, MatButtonModule, MatCardModule, MatIconModule, MatToolbarModule, MatListModule, MatInputModule, MatFormFieldModule, MatDialogModule, MatStepperModule),
29+
provideHttpClient(withInterceptorsFromDi()),
30+
provideAnimations()
31+
]
32+
})
1233
.catch(err => console.error(err));

0 commit comments

Comments
 (0)