{
+ return this.http.get(this.apiRoot + 'order/' + orderId);
+ }
+}
diff --git a/web-app/src/app/app.component.html b/web-app/src/app/app.component.html
index 00dfb058..3372191b 100644
--- a/web-app/src/app/app.component.html
+++ b/web-app/src/app/app.component.html
@@ -23,4 +23,4 @@ Your Orders
-
\ No newline at end of file
+
diff --git a/web-app/src/app/app.component.ts b/web-app/src/app/app.component.ts
index b34d9546..b0011b47 100644
--- a/web-app/src/app/app.component.ts
+++ b/web-app/src/app/app.component.ts
@@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
-import { HttpClient } from '@angular/common/http';
import { Component } from '@angular/core';
import { RouterModule } from '@angular/router';
+import { ApiService } from './api.service';
@Component({
standalone: true,
@@ -13,10 +13,15 @@ import { RouterModule } from '@angular/router';
export class AppComponent {
orders: any[] = [];
year = new Date().getFullYear();
+ title: string = 'List of orders';
- constructor(http: HttpClient) {
- http.get('/api/order/1').subscribe((orders) => {
- this.orders = orders;
+ constructor(private apiService: ApiService) {
+ this.fetchOrders();
+ }
+
+ private fetchOrders(): void {
+ this.apiService.getOrders(1).subscribe((data) => {
+ this.orders = data;
});
}
}
diff --git a/web-app/tsconfig.app.json b/web-app/tsconfig.app.json
index 3c5c0c56..374cc9d2 100644
--- a/web-app/tsconfig.app.json
+++ b/web-app/tsconfig.app.json
@@ -1,10 +1,14 @@
+/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
- "outDir": "./dist/out-tsc",
+ "outDir": "./out-tsc/app",
"types": []
},
- "files": ["src/main.ts"],
- "include": ["src/**/*.d.ts"],
- "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"]
+ "files": [
+ "src/main.ts"
+ ],
+ "include": [
+ "src/**/*.d.ts"
+ ]
}
diff --git a/web-app/tsconfig.editor.json b/web-app/tsconfig.editor.json
deleted file mode 100644
index 8ae117d9..00000000
--- a/web-app/tsconfig.editor.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "extends": "./tsconfig.json",
- "include": ["src/**/*.ts"],
- "compilerOptions": {
- "types": ["jest", "node"]
- }
-}
diff --git a/web-app/tsconfig.json b/web-app/tsconfig.json
index dcc25c1d..eb49734a 100644
--- a/web-app/tsconfig.json
+++ b/web-app/tsconfig.json
@@ -1,43 +1,28 @@
+/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
+ "compileOnSave": false,
"compilerOptions": {
- "rootDir": ".",
+ "outDir": "./dist/out-tsc",
+ "strict": true,
+ "noImplicitOverride": true,
+ "noPropertyAccessFromIndexSignature": true,
+ "noImplicitReturns": true,
+ "noFallthroughCasesInSwitch": true,
+ "skipLibCheck": true,
+ "esModuleInterop": true,
"sourceMap": true,
"declaration": false,
- "moduleResolution": "node",
- "emitDecoratorMetadata": true,
"experimentalDecorators": true,
+ "moduleResolution": "node",
"importHelpers": true,
- "target": "es2022",
- "module": "esnext",
- "lib": ["es2020", "dom"],
- "skipLibCheck": true,
- "skipDefaultLibCheck": true,
- "baseUrl": ".",
- "paths": {},
+ "target": "ES2022",
+ "module": "ES2022",
"useDefineForClassFields": false,
- "esModuleInterop": true,
- "forceConsistentCasingInFileNames": true,
- "strict": true,
- "noImplicitOverride": true,
- "noPropertyAccessFromIndexSignature": true,
- "noImplicitReturns": true,
- "noFallthroughCasesInSwitch": true
+ "lib": [
+ "ES2022",
+ "dom"
+ ]
},
- "files": [],
- "include": [],
- "references": [
- {
- "path": "./tsconfig.app.json"
- },
- {
- "path": "./tsconfig.spec.json"
- },
- {
- "path": "./tsconfig.editor.json"
- }
- ],
- "compileOnSave": false,
- "exclude": ["node_modules", "tmp"],
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
diff --git a/web-app/tsconfig.spec.json b/web-app/tsconfig.spec.json
index 1dbe7f64..be7e9da7 100644
--- a/web-app/tsconfig.spec.json
+++ b/web-app/tsconfig.spec.json
@@ -1,15 +1,13 @@
+/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
- "outDir": "./dist/out-tsc",
- "module": "commonjs",
- "target": "es2016",
- "types": ["jest", "node"]
+ "outDir": "./out-tsc/spec",
+ "types": [
+ "jasmine"
+ ]
},
- "files": ["src/test-setup.ts"],
"include": [
- "jest.config.ts",
- "src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.d.ts"
]