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 --- .../src/app/main-page/main-page.component.css | 0 .../src/app/main-page/main-page.component.html | 72 ++++++++++++++++++++++ .../src/app/main-page/main-page.component.spec.ts | 25 ++++++++ .../front/src/app/main-page/main-page.component.ts | 35 +++++++++++ 4 files changed, 132 insertions(+) create mode 100644 sandbox/testAppSonja/frontend/front/src/app/main-page/main-page.component.css create mode 100644 sandbox/testAppSonja/frontend/front/src/app/main-page/main-page.component.html create mode 100644 sandbox/testAppSonja/frontend/front/src/app/main-page/main-page.component.spec.ts create mode 100644 sandbox/testAppSonja/frontend/front/src/app/main-page/main-page.component.ts (limited to 'sandbox/testAppSonja/frontend/front/src/app/main-page') diff --git a/sandbox/testAppSonja/frontend/front/src/app/main-page/main-page.component.css b/sandbox/testAppSonja/frontend/front/src/app/main-page/main-page.component.css new file mode 100644 index 00000000..e69de29b diff --git a/sandbox/testAppSonja/frontend/front/src/app/main-page/main-page.component.html b/sandbox/testAppSonja/frontend/front/src/app/main-page/main-page.component.html new file mode 100644 index 00000000..d731a5bd --- /dev/null +++ b/sandbox/testAppSonja/frontend/front/src/app/main-page/main-page.component.html @@ -0,0 +1,72 @@ +

Spisak studenata

+ + + + + + + + + + + + + + + + + + + + + + + + +
Ime i prezimeBroj indeksaProsecna ocenaAdresaBroj telefona
{{student.firstName}} {{student.lastName}}{{student.regNum}}{{student.gpa}}{{student.address}}{{student.phoneNum}} + + + +
+ +
+ +
+ + + + \ No newline at end of file diff --git a/sandbox/testAppSonja/frontend/front/src/app/main-page/main-page.component.spec.ts b/sandbox/testAppSonja/frontend/front/src/app/main-page/main-page.component.spec.ts new file mode 100644 index 00000000..c2d5899c --- /dev/null +++ b/sandbox/testAppSonja/frontend/front/src/app/main-page/main-page.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MainPageComponent } from './main-page.component'; + +describe('MainPageComponent', () => { + let component: MainPageComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ MainPageComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(MainPageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sandbox/testAppSonja/frontend/front/src/app/main-page/main-page.component.ts b/sandbox/testAppSonja/frontend/front/src/app/main-page/main-page.component.ts new file mode 100644 index 00000000..cf749fc3 --- /dev/null +++ b/sandbox/testAppSonja/frontend/front/src/app/main-page/main-page.component.ts @@ -0,0 +1,35 @@ +import { Component, OnInit } from '@angular/core'; +import { StudentService } from '../services/student.service'; +import { Student } from '../Student'; + +@Component({ + selector: 'app-main-page', + templateUrl: './main-page.component.html', + styleUrls: ['./main-page.component.css'] +}) +export class MainPageComponent implements OnInit { + + public students: Student[] = []; + submitted = false; + count: number = 0; + + constructor(private studentService: StudentService) { } + + ngOnInit(): void { + this.studentService + .getStudents() + .subscribe((students : Student[]) => this.students = students); + } + + pickStudentForDelete(id: number) { + this.studentService.deleteStudent(id) + .subscribe( + data => { + this.submitted = true; + this.ngOnInit(); + //console.log("Data: " + data); + } + ); + } + +} -- cgit v1.2.3