#StackBounty: #angular #angular6 How to add Angular 6 side bar to add header and sub menu

Bounty: 50

Im beginner for the angular , I used angular 6 for my university project ,
i created the side bar its working good, but i try to do to add sub menu but not working.I want to know how to do that correctly , please help me to do that

Thanks ,

im used this dash board

example submenu

ample submenu

sidebar.ts

    import { Component, OnInit } from '@angular/core';

    declare const $: any;
    declare interface RouteInfo {
        path: string;
        title: string;
        icon: string;
        class: string;
    }
    export const ROUTES: RouteInfo[] = [
        { path: '/dashboard', title: 'Dashboard',  icon: 'home', class: '' },
        { path: '/class', title: 'Class',  icon: 'description', class: '' },
        { path: '/student', title: 'Students',  icon: 'apps', class: '' },
        { path: '/profile', title: 'Profile',  icon: 'person', class: '' },

    ];

    @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).width() > 991) {
          return false;
      }
      return true;
  };
}

sidebar.html

routing.ts

export const AdminLayoutRoutes: Routes = [

    { path: 'dashboard',      component: DashboardComponent },
    { path: 'class',      component: ClassComponent },
    { path: 'student',      component: StudentComponent },
   { path: 'profile',      component: ProfileComponent},

];


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.