From dce4e644d5e5d9c97ff5ac337448b52f2a2a64fd Mon Sep 17 00:00:00 2001 From: TAMARA JERINIC Date: Wed, 2 Mar 2022 23:38:27 +0100 Subject: Merge branch 'dev' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into Tamara # Conflicts: # .gitignore --- .../frontend/src/app/laptop/laptop.component.css | 22 ++++++++++++ .../frontend/src/app/laptop/laptop.component.html | 41 ++++++++++++++++++++++ .../src/app/laptop/laptop.component.spec.ts | 25 +++++++++++++ .../frontend/src/app/laptop/laptop.component.ts | 30 ++++++++++++++++ 4 files changed, 118 insertions(+) create mode 100755 sandbox/TestIvanLjubisavljevic/frontend/src/app/laptop/laptop.component.css create mode 100755 sandbox/TestIvanLjubisavljevic/frontend/src/app/laptop/laptop.component.html create mode 100755 sandbox/TestIvanLjubisavljevic/frontend/src/app/laptop/laptop.component.spec.ts create mode 100755 sandbox/TestIvanLjubisavljevic/frontend/src/app/laptop/laptop.component.ts (limited to 'sandbox/TestIvanLjubisavljevic/frontend/src/app/laptop') diff --git a/sandbox/TestIvanLjubisavljevic/frontend/src/app/laptop/laptop.component.css b/sandbox/TestIvanLjubisavljevic/frontend/src/app/laptop/laptop.component.css new file mode 100755 index 00000000..6d5e47ba --- /dev/null +++ b/sandbox/TestIvanLjubisavljevic/frontend/src/app/laptop/laptop.component.css @@ -0,0 +1,22 @@ +table { + border-collapse: collapse; + width: 100%; + border: 1px solid green; + margin-top:15px; + } + +th{ + border:1px solid green; + height: 30px; + background-color:springgreen; +} + +td{ + border:1px solid salmon; + height: 30px; + text-align: center; +} +#forma{ + width: 250px; + margin: auto; +} \ No newline at end of file diff --git a/sandbox/TestIvanLjubisavljevic/frontend/src/app/laptop/laptop.component.html b/sandbox/TestIvanLjubisavljevic/frontend/src/app/laptop/laptop.component.html new file mode 100755 index 00000000..e1f90df3 --- /dev/null +++ b/sandbox/TestIvanLjubisavljevic/frontend/src/app/laptop/laptop.component.html @@ -0,0 +1,41 @@ +
+

Karakteristike laptopa:

+ Brend: {{laptop.brand}}
+ Model: {{laptop.model}}
+ RAM: {{laptop.ram}} GB
+ HDD: {{laptop.hdd}} GB
+ Grafika: {{laptop.graphics}} (GB)
+ Dijagonala ekrana: {{laptop.display}} "
+ Procesor: {{laptop.processor}}
+ Cena: {{laptop.price}} €

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LAPTOPOVI MARKE {{laptop.brand}}
BrendMODELRAMHDDGrafikaDijagonala ekranaProcesorCena
{{laptop.brand}}{{laptop.model}}{{laptop.ram}}{{laptop.hdd}}{{laptop.graphics}}{{laptop.display}}{{laptop.processor}}{{laptop.price}} €
+
+ \ No newline at end of file diff --git a/sandbox/TestIvanLjubisavljevic/frontend/src/app/laptop/laptop.component.spec.ts b/sandbox/TestIvanLjubisavljevic/frontend/src/app/laptop/laptop.component.spec.ts new file mode 100755 index 00000000..a9ef8a05 --- /dev/null +++ b/sandbox/TestIvanLjubisavljevic/frontend/src/app/laptop/laptop.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LaptopComponent } from './laptop.component'; + +describe('LaptopComponent', () => { + let component: LaptopComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ LaptopComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(LaptopComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sandbox/TestIvanLjubisavljevic/frontend/src/app/laptop/laptop.component.ts b/sandbox/TestIvanLjubisavljevic/frontend/src/app/laptop/laptop.component.ts new file mode 100755 index 00000000..94d711bb --- /dev/null +++ b/sandbox/TestIvanLjubisavljevic/frontend/src/app/laptop/laptop.component.ts @@ -0,0 +1,30 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { Laptop } from '../models/laptop'; +import { LibraryServiceService } from '../services/library.service'; + +@Component({ + selector: 'app-laptop', + templateUrl: './laptop.component.html', + styleUrls: ['./laptop.component.css'] +}) +export class LaptopComponent implements OnInit { + laptop?:Laptop + laptopoviM?:Laptop[] + constructor(private library: LibraryServiceService, private route:ActivatedRoute, private router:Router) { } + + ngOnInit(): void { + + this.route.params.subscribe(url =>{ + this.library.dajLaptop(url["id"]).subscribe(laptop=>{ + this.laptop = laptop; + }) + }) + } + + + pogledaj(id:String) + { + this.router.navigate(["/laptop/"+id]) + } +} -- cgit v1.2.3