mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2024-11-12 17:43:57 +00:00
WIP: proile component created.
This commit is contained in:
parent
92de923fad
commit
8eba80f7d4
15
Frontend/src/app/components/profile/profile.component.html
Normal file
15
Frontend/src/app/components/profile/profile.component.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<div class="container" *ngIf="currentUser; else loggedOut">
|
||||
<p>
|
||||
<strong>e-mail</strong>
|
||||
{{ currentUser.email}}
|
||||
</p>
|
||||
<p>
|
||||
<strong>username:</strong>
|
||||
{{ currentUser.username}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<ng-template #loggedOut>
|
||||
Please login.
|
||||
</ng-template>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ProfileComponent } from './profile.component';
|
||||
|
||||
describe('ProfileComponent', () => {
|
||||
let component: ProfileComponent;
|
||||
let fixture: ComponentFixture<ProfileComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ ProfileComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ProfileComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
25
Frontend/src/app/components/profile/profile.component.ts
Normal file
25
Frontend/src/app/components/profile/profile.component.ts
Normal file
|
@ -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);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user