You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

59 lines
1.7 KiB

import { Component, OnInit } from '@angular/core';
import { RouterService } from '../services/routerService';
import { FooterService } from './footer.service';
@Component({
selector: 'app-footer',
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.scss']
})
export class FooterComponent implements OnInit {
// thumbArr:Array<string> = ['footer_home.png', 'footer_leave.png', 'footer_flexi.png', 'footer_ODFPNR.png', 'footer_attendance.png'];
//resetArr:Array<string> = ['footer_home.png', 'footer_leave.png', 'footer_flexi.png', 'footer_ODFPNR.png', 'footer_attendance.png'];
basePath:string = 'assets/images/';
previousSelectedItem:string = '';
selectedItemObject:any = {
home : false,
leave :false,
flexi:false,
odf:false,
attendance:false
}
constructor(private footerService:FooterService, private routerService:RouterService) { }
ngOnInit(): void {
}
selectedItem(selectedItem:string):void {
if(this.previousSelectedItem.length > 0){
this.selectedItemObject[this.previousSelectedItem] = false;
}
switch(selectedItem){
case 'home':
this.selectedItemObject.home = true;
break;
case 'leave':
this.selectedItemObject.leave = true;
break;
case 'flexi':
this.selectedItemObject.flexi = true;
break;
case 'odf':
this.selectedItemObject.odf = true;
break;
case 'attendance':
this.selectedItemObject.attendance = true;
break;
default:
this.selectedItemObject.home = true;
}
this.footerService.saveSelectedScreen(selectedItem);
this.routerService.navigate('dashboard');
this.previousSelectedItem = selectedItem;
}
}