From 022d7840fd87f2d22772f9603eae7f4e9f61ebc3 Mon Sep 17 00:00:00 2001 From: maciej Date: Wed, 9 Apr 2025 18:56:27 +0200 Subject: [PATCH] Upload files to "src/app" --- src/app/app.component.css | Bin 0 -> 1024 bytes src/app/app.component.html | 56 ++++++++++++++++++++++++++++++++++ src/app/app.component.spec.ts | 35 +++++++++++++++++++++ src/app/app.component.ts | 46 ++++++++++++++++++++++++++++ src/app/app.module.ts | 20 ++++++++++++ 5 files changed, 157 insertions(+) create mode 100644 src/app/app.component.css create mode 100644 src/app/app.component.html create mode 100644 src/app/app.component.spec.ts create mode 100644 src/app/app.component.ts create mode 100644 src/app/app.module.ts diff --git a/src/app/app.component.css b/src/app/app.component.css new file mode 100644 index 0000000000000000000000000000000000000000..06d7405020018ddf3cacee90fd4af10487da3d20 GIT binary patch literal 1024 ScmZQz7zLvtFd70QH3R?z00031 literal 0 HcmV?d00001 diff --git a/src/app/app.component.html b/src/app/app.component.html new file mode 100644 index 0000000..2a287a5 --- /dev/null +++ b/src/app/app.component.html @@ -0,0 +1,56 @@ +
+
+
+
+

Dane klienta

+
+
+ + +
+
+ + +
+
+ + +
+
+ +

Zamówienie

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ +
+ + +
+ +
+
+ + diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts new file mode 100644 index 0000000..e8d0b3a --- /dev/null +++ b/src/app/app.component.spec.ts @@ -0,0 +1,35 @@ +import { TestBed } from '@angular/core/testing'; +import { RouterModule } from '@angular/router'; +import { AppComponent } from './app.component'; + +describe('AppComponent', () => { + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ + RouterModule.forRoot([]) + ], + declarations: [ + AppComponent + ], + }).compileComponents(); + }); + + it('should create the app', () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.componentInstance; + expect(app).toBeTruthy(); + }); + + it(`should have as title 'zst-a51-angular-projekt'`, () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.componentInstance; + expect(app.title).toEqual('zst-a51-angular-projekt'); + }); + + it('should render title', () => { + const fixture = TestBed.createComponent(AppComponent); + fixture.detectChanges(); + const compiled = fixture.nativeElement as HTMLElement; + expect(compiled.querySelector('h1')?.textContent).toContain('Hello, zst-a51-angular-projekt'); + }); +}); diff --git a/src/app/app.component.ts b/src/app/app.component.ts new file mode 100644 index 0000000..434a794 --- /dev/null +++ b/src/app/app.component.ts @@ -0,0 +1,46 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-root', + templateUrl: './app.component.html', + standalone: false, + styleUrl: './app.component.css' +}) +export class AppComponent { + title = 'zst-a51-angular-projekt'; + + formImie: string = ''; + formNazwisko: string = ''; + formEmail: string = ''; + formModel: string = ''; + formIlosc: string = ''; + + + selectedProduct: string = ''; + images: { [key: string]: string } = { + "1": 'img1.jpg', + "2": 'img2.jpg', + "3": 'img3.jpg', + }; + + switchTheme() { + if (document.documentElement.getAttribute('data-bs-theme') == 'dark') { + document.documentElement.setAttribute('data-bs-theme', 'light'); + } else { + document.documentElement.setAttribute('data-bs-theme', 'dark'); + } + } + + submitForm() { + console.log("Imię: " + this.formImie); + console.log("Nazwisko: " + this.formNazwisko); + console.log("Email: " + this.formEmail); + console.log("Produkt: " + this.selectedProduct); + console.log("Model: " + this.formModel); + console.log("Ilość: " + this.formIlosc); + } + + get imageSrc(): string { + return this.images[this.selectedProduct]; + } +} diff --git a/src/app/app.module.ts b/src/app/app.module.ts new file mode 100644 index 0000000..77378cc --- /dev/null +++ b/src/app/app.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; + +import { AppRoutingModule } from './app-routing.module'; +import { AppComponent } from './app.component'; +import {FormsModule} from "@angular/forms"; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ + BrowserModule, + AppRoutingModule, + FormsModule + ], + providers: [], + bootstrap: [AppComponent] +}) +export class AppModule { }