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 --- .../app/izmeni-laptop/izmeni-laptop.component.css | 10 +++++ .../app/izmeni-laptop/izmeni-laptop.component.html | 25 +++++++++++++ .../izmeni-laptop/izmeni-laptop.component.spec.ts | 25 +++++++++++++ .../app/izmeni-laptop/izmeni-laptop.component.ts | 43 ++++++++++++++++++++++ 4 files changed, 103 insertions(+) create mode 100755 sandbox/TestIvanLjubisavljevic/frontend/src/app/izmeni-laptop/izmeni-laptop.component.css create mode 100755 sandbox/TestIvanLjubisavljevic/frontend/src/app/izmeni-laptop/izmeni-laptop.component.html create mode 100755 sandbox/TestIvanLjubisavljevic/frontend/src/app/izmeni-laptop/izmeni-laptop.component.spec.ts create mode 100755 sandbox/TestIvanLjubisavljevic/frontend/src/app/izmeni-laptop/izmeni-laptop.component.ts (limited to 'sandbox/TestIvanLjubisavljevic/frontend/src/app/izmeni-laptop') diff --git a/sandbox/TestIvanLjubisavljevic/frontend/src/app/izmeni-laptop/izmeni-laptop.component.css b/sandbox/TestIvanLjubisavljevic/frontend/src/app/izmeni-laptop/izmeni-laptop.component.css new file mode 100755 index 00000000..ab085673 --- /dev/null +++ b/sandbox/TestIvanLjubisavljevic/frontend/src/app/izmeni-laptop/izmeni-laptop.component.css @@ -0,0 +1,10 @@ +input{ + margin:5px; +} +button{ + margin:5px; +} +#forma{ + width: 250px; + margin: auto; +} \ No newline at end of file diff --git a/sandbox/TestIvanLjubisavljevic/frontend/src/app/izmeni-laptop/izmeni-laptop.component.html b/sandbox/TestIvanLjubisavljevic/frontend/src/app/izmeni-laptop/izmeni-laptop.component.html new file mode 100755 index 00000000..c49a700d --- /dev/null +++ b/sandbox/TestIvanLjubisavljevic/frontend/src/app/izmeni-laptop/izmeni-laptop.component.html @@ -0,0 +1,25 @@ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+

Uspešno izmenjeni podaci!

+
\ No newline at end of file diff --git a/sandbox/TestIvanLjubisavljevic/frontend/src/app/izmeni-laptop/izmeni-laptop.component.spec.ts b/sandbox/TestIvanLjubisavljevic/frontend/src/app/izmeni-laptop/izmeni-laptop.component.spec.ts new file mode 100755 index 00000000..cd33375a --- /dev/null +++ b/sandbox/TestIvanLjubisavljevic/frontend/src/app/izmeni-laptop/izmeni-laptop.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { IzmeniLaptopComponent } from './izmeni-laptop.component'; + +describe('IzmeniLaptopComponent', () => { + let component: IzmeniLaptopComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ IzmeniLaptopComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(IzmeniLaptopComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sandbox/TestIvanLjubisavljevic/frontend/src/app/izmeni-laptop/izmeni-laptop.component.ts b/sandbox/TestIvanLjubisavljevic/frontend/src/app/izmeni-laptop/izmeni-laptop.component.ts new file mode 100755 index 00000000..7a4f44b4 --- /dev/null +++ b/sandbox/TestIvanLjubisavljevic/frontend/src/app/izmeni-laptop/izmeni-laptop.component.ts @@ -0,0 +1,43 @@ +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-izmeni-laptop', + templateUrl: './izmeni-laptop.component.html', + styleUrls: ['./izmeni-laptop.component.css'] +}) +export class IzmeniLaptopComponent implements OnInit { + laptop?:Laptop + izmenio?:boolean + constructor(private router:Router,private library:LibraryServiceService, private route:ActivatedRoute) { } + + ngOnInit(): void { + this.route.params.subscribe(url=>{ + this.library.dajLaptop(url["id"]).subscribe(laptop =>{ + this.laptop = laptop + }) + }) + } + + izmeni(laptop?:Laptop) + { + this.library.izmeniLaptop(laptop).subscribe(laptop=>{ + this.route.params.subscribe(url=>{ + this.library.dajLaptop(url["id"]).subscribe(laptop =>{ + this.laptop = laptop + this.izmenio = true; + }) + }) + }) + } + + back() + { + this.router.navigate(["/homepage"]) + } + + + +} -- cgit v1.2.3