File tree Expand file tree Collapse file tree 3 files changed +21
-12
lines changed Expand file tree Collapse file tree 3 files changed +21
-12
lines changed Original file line number Diff line number Diff line change 1+ export interface ItemSidebar {
2+ route : string ;
3+ icon : string ;
4+ text : string ;
5+ }
Original file line number Diff line number Diff line change 11< div class ="d-flex " id ="wrapper ">
22 <!-- Sidebar -->
3- < div class ="bg-light border-right " id ="sidebar-wrapper ">
3+ < div class ="bg-light border-right " id ="sidebar-wrapper " *ngIf =" itemsSidebar?.length > 0 " >
44 < div class ="list-group list-group-flush ">
5- < a [routerLink] ="['/time-clock'] " routerLinkActive ="dark "
6- class ="list-group-item list-group-item-action bg-light "> < i class ="far fa-clock "> </ i > Time Clock</ a >
7- < a [routerLink] ="['/time-entries'] " routerLinkActive ="dark "
8- class ="list-group-item list-group-item-action bg-light "> < i class ="far fa-list-alt "> </ i > Time Entries</ a >
9- < a [routerLink] ="['/reports'] " routerLinkActive ="dark " class ="list-group-item list-group-item-action bg-light "> < i
10- class ="fas fa-chart-pie "> </ i > Reports</ a >
11- < a [routerLink] ="['/project-management'] " routerLinkActive ="dark "
12- class ="list-group-item list-group-item-action bg-light "> < i class ="far fa-folder-open "> </ i > Projects</ a >
13- < a [routerLink] ="['/activities-management'] " routerLinkActive ="dark "
14- class ="list-group-item list-group-item-action bg-light "> < i class ="far fa-file-alt "> </ i > Activities</ a >
5+ < a *ngFor ="let item of itemsSidebar " [routerLink] ="item.route " routerLinkActive ="dark "
6+ class ="list-group-item list-group-item-action bg-light "> < i class ="{{item.icon}} "> </ i > {{item.text}}</ a >
157 </ div >
168 </ div >
179 <!-- /#sidebar-wrapper -->
Original file line number Diff line number Diff line change 11import { Component , OnInit } from '@angular/core' ;
2-
2+ import { ItemSidebar } from './models/item-sidebar.model' ;
33@Component ( {
44 selector : 'app-sidebar' ,
55 templateUrl : './sidebar.component.html' ,
66 styleUrls : [ './sidebar.component.scss' ]
77} )
88export class SidebarComponent implements OnInit {
99
10+ itemsSidebar : ItemSidebar [ ] = [ ] ;
11+
1012 constructor ( ) { }
1113
1214 ngOnInit ( ) : void {
15+ this . getItemsSidebar ( ) ;
1316 }
1417
18+ getItemsSidebar ( ) {
19+ this . itemsSidebar = [
20+ { route : './time-clock' , icon : 'far fa-clock' , text : 'Time Clock' } ,
21+ { route : './time-entries' , icon : 'far fa-list-alt' , text : 'Time Entries' } ,
22+ { route : './reports' , icon : 'fas fa-chart-pie' , text : 'Reports' } ,
23+ { route : './project-management' , icon : 'far fa-folder-open' , text : 'Projects' } ,
24+ { route : './activities-management' , icon : 'far fa-file-alt' , text : 'Activities' }
25+ ] ;
26+ }
1527}
You can’t perform that action at this time.
0 commit comments