-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Menu Added, and will not show if on Login or Register pages New Pages: Bugs Corrected: To Be Corrected:
- Loading branch information
1 parent
3fb0eca
commit 5b1d8c6
Showing
12 changed files
with
59 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
<ion-app> | ||
<ion-router-outlet></ion-router-outlet> | ||
<ion-split-pane when="md" contentId="menu-content" > | ||
<ion-menu content-id="menu-content" menu-id="menu-id" side="start" type="overlay"> | ||
<ion-header> | ||
<ion-toolbar > | ||
<ion-title> | ||
Menu | ||
</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<ion-list class="h-full"> | ||
<ion-menu-toggle *ngFor="let item of menuItems" auto-hide="false"> | ||
<ion-item [routerLink]="item.url"> | ||
<ion-icon [name]="item.icon" slot="start"></ion-icon> | ||
<ion-label color="primary">{{item.title}}</ion-label> | ||
</ion-item> | ||
</ion-menu-toggle> | ||
</ion-list> | ||
</ion-content> | ||
</ion-menu> | ||
<ion-router-outlet id="menu-content"></ion-router-outlet> | ||
</ion-split-pane> | ||
</ion-app> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,34 @@ | ||
import { Component } from '@angular/core'; | ||
import { Component, OnInit } from '@angular/core'; | ||
import { Router, NavigationEnd } from '@angular/router'; | ||
import { MenuController } from '@ionic/angular'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: 'app.component.html', | ||
styleUrls: ['app.component.scss'], | ||
}) | ||
export class AppComponent { | ||
constructor() {} | ||
export class AppComponent implements OnInit { | ||
|
||
menuItems = [ | ||
{ | ||
title: 'Home', | ||
url: '/home', | ||
icon: 'home' | ||
}, | ||
]; | ||
|
||
constructor(private router: Router, private menuController: MenuController) {} | ||
|
||
ngOnInit() { | ||
this.router.events.subscribe((event) => { | ||
if (event instanceof NavigationEnd) { | ||
// Disable the menu on Login and Register pages | ||
if (event.urlAfterRedirects.includes('/login') || event.urlAfterRedirects.includes('/register')) { | ||
this.menuController.enable(false); | ||
} else { | ||
this.menuController.enable(true); | ||
} | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.