Skip to content

Commit e03e0fa

Browse files
committed
feat: use standalone
1 parent bca1a2f commit e03e0fa

File tree

14 files changed

+149
-159
lines changed

14 files changed

+149
-159
lines changed

frontend/src/angular/src/app/app-routing.module.ts renamed to frontend/src/angular/src/app/app-routing.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@
1212
See the License for the specific language governing permissions and
1313
limitations under the License.
1414
*/
15-
import { NgModule } from "@angular/core";
16-
import { Routes, RouterModule, PreloadAllModules } from "@angular/router";
15+
import { Routes } from "@angular/router";
1716
import { AuthGuardService } from "./services/auth-guard.service";
1817
import { SplashComponent } from "./splash/splash.component";
1918

20-
const routes: Routes = [
19+
export const routes: Routes = [
2120
{
2221
path: "overview",
2322
loadChildren: () =>
24-
import("./overview/overview.module").then((m) => m.OverviewModule),
23+
import("./overview/overview.routes").then((m) => m.routes),
2524
},
2625
{
2726
path: "details",
@@ -31,7 +30,7 @@ const routes: Routes = [
3130
{
3231
path: "orderbooks",
3332
loadChildren: () =>
34-
import("./orderbooks/orderbooks.module").then((m) => m.OrderbooksModule),
33+
import("./orderbooks/orderbooks.routes").then((m) => m.routes),
3534
canActivate: [AuthGuardService],
3635
},
3736
{
@@ -41,14 +40,3 @@ const routes: Routes = [
4140
},
4241
{ path: "**", component: SplashComponent },
4342
];
44-
45-
@NgModule({
46-
imports: [
47-
RouterModule.forRoot(routes, {
48-
enableTracing: false,
49-
preloadingStrategy: PreloadAllModules,
50-
}),
51-
],
52-
exports: [RouterModule],
53-
})
54-
export class AppRoutingModule {}

frontend/src/angular/src/app/app.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
*/
1616
import { Component, Inject, LOCALE_ID, OnInit } from "@angular/core";
1717
import { environment } from "./../environments/environment";
18+
import { RouterModule } from "@angular/router";
1819

1920
@Component({
2021
selector: "app-root",
22+
imports: [RouterModule],
2123
templateUrl: "./app.component.html",
22-
styleUrls: ["./app.component.scss"],
23-
standalone: false
24+
styleUrls: ["./app.component.scss"],
2425
})
2526
export class AppComponent implements OnInit {
2627
protected title = "app";

frontend/src/angular/src/app/app.module.ts renamed to frontend/src/angular/src/app/app.config.ts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,24 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
import { BrowserModule } from "@angular/platform-browser";
17-
import { NgModule } from "@angular/core";
18-
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
19-
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from "@angular/common/http";
20-
21-
import { AppRoutingModule } from "./app-routing.module";
22-
import { AppComponent } from "./app.component";
23-
import { SplashComponent } from "./splash/splash.component";
24-
import { MatProgressSpinnerModule } from "@angular/material/progress-spinner";
16+
import { ApplicationConfig, importProvidersFrom } from "@angular/core";
17+
import { provideAnimations } from "@angular/platform-browser/animations";
18+
import { provideHttpClient, withInterceptorsFromDi } from "@angular/common/http";
19+
import { routes } from "./app-routing";
2520
import {
26-
NgxServiceModule,
27-
SimpleChartsConfig,
21+
NgxServiceModule,
2822
} from "ngx-simple-charts/base-service";
23+
import { provideRouter } from "@angular/router";
24+
25+
export const appConfig: ApplicationConfig = {
26+
providers: [provideRouter(routes), provideAnimations(), provideHttpClient(withInterceptorsFromDi()), importProvidersFrom(NgxServiceModule.forRoot({
27+
tokenRefreshPath: "/rest/auth/refreshToken",
28+
logoutPath: "/rest/auth/logout",
29+
loginRoute: "/",
30+
}))],
31+
};
2932

33+
/*
3034
@NgModule({ declarations: [AppComponent, SplashComponent],
3135
bootstrap: [AppComponent], imports: [BrowserModule,
3236
AppRoutingModule,
@@ -38,3 +42,4 @@ import {
3842
loginRoute: "/login",
3943
})], providers: [provideHttpClient(withInterceptorsFromDi())] })
4044
export class AppModule {}
45+
*/
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Copyright 2018 Sven Loesekann
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
13+
export * from './orderbooks.routes';

frontend/src/angular/src/app/orderbooks/orderbooks.module.ts

Lines changed: 0 additions & 46 deletions
This file was deleted.

frontend/src/angular/src/app/orderbooks/orderbooks-routing.module.ts renamed to frontend/src/angular/src/app/orderbooks/orderbooks.routes.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,12 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
import { NgModule } from "@angular/core";
1716
import { Routes, RouterModule } from "@angular/router";
1817
import { OrderbooksComponent } from "./orderbooks/orderbooks.component";
1918

20-
const routes: Routes = [
19+
export const routes: Routes = [
2120
{
2221
path: "",
2322
component: OrderbooksComponent,
2423
},
2524
];
26-
27-
@NgModule({
28-
imports: [RouterModule.forChild(routes)],
29-
exports: [RouterModule],
30-
})
31-
export class OrderbooksRoutingModule {}

frontend/src/angular/src/app/orderbooks/orderbooks/orderbooks.component.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,31 @@ import { OrderbookBs } from "../../common/orderbook-bs";
2222
import { OrderbookBf, OrderBf } from "../../common/orderbook-bf";
2323
import { OrderbookIb } from "../../common/orderbook-ib";
2424
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
25+
import { MatButtonModule } from "@angular/material/button";
26+
import { CommonModule } from "@angular/common";
27+
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
28+
import { MatCheckboxModule } from "@angular/material/checkbox";
29+
import { MatInputModule } from "@angular/material/input";
30+
import { MatListModule } from "@angular/material/list";
31+
import { MatRadioModule } from "@angular/material/radio";
32+
import { MatSelectModule } from "@angular/material/select";
33+
import { MatToolbarModule } from "@angular/material/toolbar";
2534

2635
@Component({
2736
selector: "app-orderbooks",
37+
imports: [
38+
CommonModule,
39+
FormsModule,
40+
ReactiveFormsModule,
41+
MatToolbarModule,
42+
MatSelectModule,
43+
MatRadioModule,
44+
MatInputModule,
45+
MatCheckboxModule,
46+
MatButtonModule,
47+
MatListModule ],
2848
templateUrl: "./orderbooks.component.html",
29-
styleUrls: ["./orderbooks.component.scss"],
30-
standalone: false
49+
styleUrls: ["./orderbooks.component.scss"],
3150
})
3251
export class OrderbooksComponent implements OnInit {
3352
public currencies: MyCurr[];
@@ -53,8 +72,7 @@ export class OrderbooksComponent implements OnInit {
5372
new MyCurr(this.serviceBf.ETHUSD, "Eth - Usd"),
5473
new MyCurr(this.serviceBf.LTCUSD, "Ltc - Usd"),
5574
new MyCurr(this.serviceBf.XRPUSD, "Xrp - Usd"),
56-
];
57-
console.log("hallo");
75+
];
5876
}
5977
onSubmit() {
6078
//console.log( this.model );
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Copyright 2018 Sven Loesekann
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
13+
export * from './overview.routes';

frontend/src/angular/src/app/overview/login/login.component.ts

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,28 @@
1515
*/
1616
import { Component, OnInit, Inject, DestroyRef, inject } from "@angular/core";
1717
import { QuoteoverviewComponent } from "../quoteoverview/quoteoverview.component";
18-
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
18+
import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from "@angular/material/dialog";
1919
import { MyuserService } from "../../services/myuser.service";
2020
import { MyUser } from "../../common/my-user";
2121
import {
2222
FormGroup,
2323
FormBuilder,
2424
Validators,
2525
AbstractControlOptions,
26+
ReactiveFormsModule,
27+
FormsModule,
2628
} from "@angular/forms";
2729
import { TokenService } from "ngx-simple-charts/base-service";
2830
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
31+
import { CommonModule } from "@angular/common";
32+
import { LuxonDateModule } from "@angular/material-luxon-adapter";
33+
import { MatButtonModule } from "@angular/material/button";
34+
import { MatFormFieldModule } from "@angular/material/form-field";
35+
import { MatInputModule } from "@angular/material/input";
36+
import { MatProgressSpinnerModule } from "@angular/material/progress-spinner";
37+
import { MatTableModule } from "@angular/material/table";
38+
import { MatTabsModule } from "@angular/material/tabs";
39+
import { MatToolbarModule } from "@angular/material/toolbar";
2940

3041
enum FormFields {
3142
username = "username",
@@ -36,9 +47,21 @@ enum FormFields {
3647

3748
@Component({
3849
selector: "app-login",
50+
imports: [
51+
CommonModule,
52+
MatTableModule,
53+
MatToolbarModule,
54+
MatTabsModule,
55+
MatButtonModule,
56+
MatDialogModule,
57+
MatFormFieldModule,
58+
MatProgressSpinnerModule,
59+
MatInputModule,
60+
LuxonDateModule,
61+
FormsModule,
62+
ReactiveFormsModule],
3963
templateUrl: "./login.component.html",
40-
styleUrls: ["./login.component.scss"],
41-
standalone: false
64+
styleUrls: ["./login.component.scss"],
4265
})
4366
export class LoginComponent implements OnInit {
4467
protected signinForm: FormGroup;

frontend/src/angular/src/app/overview/overview.module.ts

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)