From f66ce8e159e6bee4c8638cbe528ed8f8d491cfa2 Mon Sep 17 00:00:00 2001 From: GloriousCode Date: Tue, 10 Oct 2017 17:52:12 +1100 Subject: [PATCH] Removes pagename. --- web/src/app/app.component.ts | 25 +++++++++++++++++-- .../app/shared/navbar/navbar.component.html | 1 - .../app/shared/sidebar/sidebar.component.html | 16 ------------ 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/web/src/app/app.component.ts b/web/src/app/app.component.ts index e0da5672..1cc71677 100644 --- a/web/src/app/app.component.ts +++ b/web/src/app/app.component.ts @@ -1,5 +1,8 @@ -import { Component } from '@angular/core'; +import { Component, OnInit,ViewChild } from '@angular/core'; import { ElectronService } from './providers/electron.service'; +import { MdSidenav } from '@angular/material'; +import { SidebarService } from './services/sidebar/sidebar.service'; +import { Router, NavigationEnd } from '@angular/router'; @Component({ selector: 'app-root', @@ -7,7 +10,11 @@ import { ElectronService } from './providers/electron.service'; styleUrls: ['./app.component.scss'], }) export class AppComponent { - constructor(public electronService: ElectronService) { + sidebarService: SidebarService + public currentUrl:string; + @ViewChild('sidenav') public sidenav: MdSidenav; + + constructor(public electronService: ElectronService,something: SidebarService, private router:Router) { if (electronService.isElectron()) { console.log('Mode electron'); @@ -18,5 +25,19 @@ export class AppComponent { } else { console.log('Mode web'); } + + this.sidebarService = something; + + router.events.subscribe(event => { + + if (event instanceof NavigationEnd ) { + console.log("current url",event.url); // event.url has current url + this.currentUrl = event.url; + } + }); } + + ngOnInit() { + this.sidebarService.setSidenav(this.sidenav); + } } diff --git a/web/src/app/shared/navbar/navbar.component.html b/web/src/app/shared/navbar/navbar.component.html index 45f2a341..78d6fa7a 100644 --- a/web/src/app/shared/navbar/navbar.component.html +++ b/web/src/app/shared/navbar/navbar.component.html @@ -6,6 +6,5 @@ GoCryptoTrader
- Pagename \ No newline at end of file diff --git a/web/src/app/shared/sidebar/sidebar.component.html b/web/src/app/shared/sidebar/sidebar.component.html index 1e6a84b4..e69de29b 100644 --- a/web/src/app/shared/sidebar/sidebar.component.html +++ b/web/src/app/shared/sidebar/sidebar.component.html @@ -1,16 +0,0 @@ - - - - trending_up 

Dashboard

-
- - account_balance_wallet 

Wallet

-
- - history 

Trading

-
- - settings 

Settings

-
-
-
\ No newline at end of file