mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-20 23:16:49 +00:00
Removes pagename.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user