| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame^] | 1 | <!-- |
| 2 | Copyright 2020 TATA ELXSI |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the 'License'); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | |
| 16 | Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in) |
| 17 | --> |
| 18 | <div id="sidebar" class="p-2 sidebar-mini" [class.sidebar-collapse]="classAppliedForDesktop" [class.sidebar-open]="classAppliedForMobile"> |
| 19 | <div class="custom-menu" (click)="sideBarOpenClose()"> |
| 20 | <button type="button" id="sidebarCollapse" class="btn btn-primary"> |
| 21 | <i class="fa fa-bars"></i> |
| 22 | </button> |
| 23 | </div> |
| 24 | <nav> |
| 25 | <ul class="scrollable-menu"> |
| 26 | <li *ngFor="let menu of getMenus; let i = index" [ngClass]="{'hasChild': menu.isChildExists }" |
| 27 | class="{{menu.liClass}}" id="{{menu.clickFunction}}{{i}}" |
| 28 | (click)="handleMenuFunction(i, menu.clickFunction, 'menu-open', menu.isChildExists)" |
| 29 | [routerLinkActiveOptions]="{exact: menu.routerLinkActiveOptions !== undefined ? menu.routerLinkActiveOptions : false}" |
| 30 | [routerLinkActive]="menu.routerLinkActive !== undefined ? menu.routerLinkActive : ''"> |
| 31 | <a *ngIf="menu.isChildExists" class="{{menu.anchorTagClass}}"> |
| 32 | <i class="{{menu.icon}}"></i> |
| 33 | <span>{{ menu.menuName | translate}}</span> |
| 34 | </a> |
| 35 | <a *ngIf="!menu.isChildExists" class="{{menu.anchorTagClass}}" [routerLink]="menu.routerLink"> |
| 36 | <i class="{{menu.icon}}"></i> |
| 37 | <span>{{ menu.menuName | translate}}</span> |
| 38 | </a> |
| 39 | <ul *ngIf="menu.isChildExists" class="{{menu.ulClass}}"> |
| 40 | <li *ngFor="let childMenu of menu.childItems" |
| 41 | [routerLinkActiveOptions]="{exact: childMenu.routerLinkActiveOptions}" |
| 42 | [routerLinkActive]="childMenu.routerLinkActive" (click)="checkAndCloseSideBar(childMenu.isChildExists)"> |
| 43 | <a class="{{childMenu.anchorTagClass}}" [routerLink]="childMenu.routerLink"> |
| 44 | <i class="{{childMenu.icon}}"></i> |
| 45 | <span>{{childMenu.menuName | translate}}</span> |
| 46 | </a> |
| 47 | </li> |
| 48 | </ul> |
| 49 | </li> |
| 50 | </ul> |
| 51 | </nav> |
| 52 | </div> |