12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- import { AuthServiceService } from './../../shared/auth-service.service';
- import { Component, OnInit, LOCALE_ID, Inject } from '@angular/core';
- import { Router } from '@angular/router';
- import * as moment from 'moment';
- import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
- import { UserService } from '../../shared/user.service';
- @Component({
- selector: 'app-header',
- templateUrl: './header.component.html',
- styleUrls: ['./header.component.css']
- })
- export class HeaderComponent implements OnInit {
- imgSrc: string = '../../../assets/image';
- constructor(private authSer: AuthServiceService ,
- private userSer: UserService,
- private router: Router) { }
-
- currentDate: any = Date.now();
- ngOnInit() {
- this.authSer.showHeaderLogin = true;
- this.authSer.showHeaderDashBoard = false;
- this.authSer.onGetFooterData('internal').subscribe(
- (responce) => {
- this.authSer.footerData = responce['footer'];
- console.log(this.authSer.footerData);
- },
- (error) => {
- console.log(error);
- }
- );
-
- // const m = moment().format('iYYYY/iM/iD');
- // console.log(m);
- this.currentDate = this.authSer.writeHijri(new Date(this.currentDate), 'ar', 'header');
-
- this.userSer.getUserDataProfile();
- console.log();
-
- }
- onGetProfile() {
- console.log('profile/' + this.authSer.dataLoginUser['id']);
- this.router.navigate(['profile/' + this.authSer.dataLoginUser['id']]);
- }
- //log out function
- onLogout() {
- localStorage.clear();
- //localStorage.setItem('token' , '');
- this.router.navigate(['login']);
- }
- onInternalPage() {
- this.router.navigate(['/InternalPage/home']);
- }
- }
|