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.
50 lines
1.5 KiB
TypeScript
50 lines
1.5 KiB
TypeScript
import { Component, OnInit, Input } from '@angular/core';
|
|
import { ModalController } from '@ionic/angular';
|
|
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-business-card',
|
|
templateUrl: './business-card.component.html',
|
|
styleUrls: ['./business-card.component.scss'],
|
|
})
|
|
export class BusinessCardComponent implements OnInit {
|
|
|
|
public userInfo: any;
|
|
public userJobName: any;
|
|
public jobName: any;
|
|
direction: string;
|
|
constructor(
|
|
public modalCtrl: ModalController,
|
|
public ts: TranslatorService,
|
|
public common: CommonService,
|
|
public authService: AuthenticationService,
|
|
) { }
|
|
|
|
ngOnInit() {
|
|
this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info'));
|
|
this.direction = TranslatorService.getCurrentLanguageName();
|
|
console.log(this.userInfo);
|
|
|
|
this.authService
|
|
.loadAuthenticatedUser()
|
|
.subscribe((user: AuthenticatedUser) => {
|
|
if (user) {
|
|
let jobTitle = user.POSITION_NAME.split('.');
|
|
if (jobTitle && jobTitle.length > 1) {
|
|
this.jobName = jobTitle[0] + " " + jobTitle[1];
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
dismiss() {
|
|
this.modalCtrl.dismiss({
|
|
'dismissed': true
|
|
});
|
|
}
|
|
|
|
} |