You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mohemmionic5/Mohem/src/app/profile/home/home.component.ts

39 lines
1.2 KiB
TypeScript

import { Component, OnInit } from "@angular/core";
import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user";
@Component({
selector: "app-home",
templateUrl: "./home.component.html",
styleUrls: ["./home.component.scss"]
})
export class HomeComponent implements OnInit {
personalInfo: any;
imageSrc: string = "../assets/imgs/profile.png";
constructor(
public ts: TranslatorService,
public cs: CommonService,
public authService: AuthenticationService
) {}
ngOnInit() {
this.getProfile();
}
getProfile() {
this.authService
.loadAuthenticatedUser()
.subscribe((user: AuthenticatedUser) => {
if (user) {
this.personalInfo = user;
this.imageSrc = user.EMPLOYEE_IMAGE
? "data:image/png;base64," + user.EMPLOYEE_IMAGE
: this.imageSrc;
console.log(user);
} else {
console.log(user);
}
});
}
}