sidebar.component.ts 1.45 KB
Newer Older
DESKTOP-HF0LVOG\myhr committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
import { Component, OnInit } from "@angular/core";

declare interface RouteInfo {
  path: string;
  title: string;
  rtlTitle: string;
  icon: string;
  class: string;
}
export const ROUTES: RouteInfo[] = [
  {
    path: "/home-page",
    title: "หน้าหลัก",
    rtlTitle: "",
    icon: "icon-shape-star",
    class: ""
  },
18 19 20 21 22 23 24
  {
    path: "/equipment",
    title: "รายการอุปกรณ์",
    rtlTitle: "",
    icon: "icon-cart",
    class: ""
  },
25 26 27 28 29 30 31
  {
    path: "/admin-equirment",
    title: "รายการอุปกรณ์ Admin",
    rtlTitle: "",
    icon: "icon-bag-16",
    class: ""
  },
32 33
  {
    path: "/pending",
34
    title: "รายการทั้งหมด",
35
    rtlTitle: "",
Your Name committed
36
    icon: "icon-paper",
37 38 39 40
    class: ""
  },
  {
    path: "/admin-pending",
41
    title: "รายการรออนุมัติ",
42 43 44 45
    rtlTitle: "",
    icon: "icon-bag-16",
    class: ""
  },
46
  {
47 48
    path: "/contact-admin",
    title: "ติดต่อแอดมิน",
49
    rtlTitle: "",
Your Name committed
50
    icon: "icon-settings",
51
    class: ""
Your Name committed
52
  }
DESKTOP-HF0LVOG\myhr committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
];

@Component({
  selector: "app-sidebar",
  templateUrl: "./sidebar.component.html",
  styleUrls: ["./sidebar.component.css"]
})
export class SidebarComponent implements OnInit {
  menuItems: any[];

  constructor() {}

  ngOnInit() {
    this.menuItems = ROUTES.filter(menuItem => menuItem);
  }
  isMobileMenu() {
    if (window.innerWidth > 991) {
      return false;
    }
    return true;
  }
}