|
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
|
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
|
|
|
|
import { MenuController } from '@ionic/angular';
|
|
|
|
|
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
|
|
|
|
|
import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/models/smscheck.response";
|
|
|
|
|
import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user';
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-home',
|
|
|
|
|
templateUrl: './home.page.html',
|
|
|
|
|
styleUrls: ['./home.page.scss'],
|
|
|
|
|
})
|
|
|
|
|
export class HomePage implements OnInit {
|
|
|
|
|
userData: any ={};
|
|
|
|
|
user_image : any = "../assets/imgs/profile.png";
|
|
|
|
|
constructor(public ts: TranslatorService, public menu: MenuController, public authService: AuthenticationService ) { }
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
this.getUserDetails();
|
|
|
|
|
}
|
|
|
|
|
private openMenu(){
|
|
|
|
|
this.menu.toggle();
|
|
|
|
|
}
|
|
|
|
|
private getUserDetails(){
|
|
|
|
|
const user = this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
|
|
|
|
|
if (user) {
|
|
|
|
|
this.userData=user;
|
|
|
|
|
console.log(user);
|
|
|
|
|
}else{
|
|
|
|
|
console.log(user);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// private getMenu(){
|
|
|
|
|
// this.menuService.getMenu().
|
|
|
|
|
// subscribe((result: MenuResponse) => {
|
|
|
|
|
// this.handleMenuResult(result);
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// private handleMenuResult(result){
|
|
|
|
|
// if (this.common.validResponse(result)) {
|
|
|
|
|
// if (this.common.hasData(result.List_Menu)) {
|
|
|
|
|
// this.menuList = result.List_Menu;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|