From 8eba80f7d4b85bf11e641f84311811baec880680 Mon Sep 17 00:00:00 2001 From: Jegor Date: Wed, 16 Jun 2021 09:59:25 +0200 Subject: [PATCH] WIP: proile component created. --- .../components/profile/profile.component.css | 0 .../components/profile/profile.component.html | 15 +++++++++++ .../profile/profile.component.spec.ts | 25 +++++++++++++++++++ .../components/profile/profile.component.ts | 25 +++++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 Frontend/src/app/components/profile/profile.component.css create mode 100644 Frontend/src/app/components/profile/profile.component.html create mode 100644 Frontend/src/app/components/profile/profile.component.spec.ts create mode 100644 Frontend/src/app/components/profile/profile.component.ts diff --git a/Frontend/src/app/components/profile/profile.component.css b/Frontend/src/app/components/profile/profile.component.css new file mode 100644 index 0000000..e69de29 diff --git a/Frontend/src/app/components/profile/profile.component.html b/Frontend/src/app/components/profile/profile.component.html new file mode 100644 index 0000000..d44b8bf --- /dev/null +++ b/Frontend/src/app/components/profile/profile.component.html @@ -0,0 +1,15 @@ +
+

+ e-mail + {{ currentUser.email}} +

+

+ username: + {{ currentUser.username}} +

+
+ + + Please login. + + diff --git a/Frontend/src/app/components/profile/profile.component.spec.ts b/Frontend/src/app/components/profile/profile.component.spec.ts new file mode 100644 index 0000000..e88012e --- /dev/null +++ b/Frontend/src/app/components/profile/profile.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ProfileComponent } from './profile.component'; + +describe('ProfileComponent', () => { + let component: ProfileComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ProfileComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ProfileComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Frontend/src/app/components/profile/profile.component.ts b/Frontend/src/app/components/profile/profile.component.ts new file mode 100644 index 0000000..dc8fe69 --- /dev/null +++ b/Frontend/src/app/components/profile/profile.component.ts @@ -0,0 +1,25 @@ +import { Component, OnInit } from '@angular/core'; +import {ApiService} from "../../services/api.service"; + +@Component({ + selector: 'app-profile', + templateUrl: './profile.component.html', + styleUrls: ['./profile.component.css'] +}) +export class ProfileComponent implements OnInit { + + currentUser: any; + obj:any + + constructor(private api: ApiService ) { } + + ngOnInit(): void { + + this.api.getUserInfo().subscribe( + user=> { + this.currentUser = user + console.log(this.currentUser); + }, + ); + } +}