socialnetworknews-web

A open-source Paper.li clone
git clone git://archive.git.mtrnord.blog/SocialNetworkNews/socialnetworknews-web.git
Log | Files | Refs | README | LICENSE

commit 44af380b1b2af00a1a12bb18d4bc05854bbf7428
parent 7f4959aa19394644eafcf6f4ba19caf06f2aaea3
Author: MTRNord <mtrnord1@gmail.com>
Date:   Wed, 21 Mar 2018 20:14:55 +0100

Remove totally unnecessary code

Diffstat:
Msrc/app/app.component.html | 6+++---
Msrc/app/app.component.ts | 16----------------
2 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/src/app/app.component.html b/src/app/app.component.html @@ -8,9 +8,9 @@ </a> </div> <nav> - <a class="nav--link" routerLink="/" [routerLinkActive]="checkCurrent()">Home</a> - <a class="nav--link" routerLink="/features" [routerLinkActive]="checkCurrent('/features')">Features</a> - <a class="nav--link" routerLink="/papers" [routerLinkActive]="checkCurrent('/papers')">Papers</a> + <a class="nav--link" routerLink="/">Home</a> + <a class="nav--link" routerLink="/features">Features</a> + <a class="nav--link" routerLink="/papers">Papers</a> </nav> </div> diff --git a/src/app/app.component.ts b/src/app/app.component.ts @@ -1,5 +1,4 @@ import {Component} from '@angular/core'; -import {NavigationEnd, Router} from '@angular/router'; @Component({ selector: 'app-root', @@ -7,19 +6,4 @@ import {NavigationEnd, Router} from '@angular/router'; styleUrls: ['./app.component.scss'] }) export class AppComponent { - currentUrl: string; - constructor(router: Router) { - router.events.subscribe((value) => { - if (value instanceof NavigationEnd ) { - this.currentUrl = value.url; - } - }); - } - - checkCurrent(path = '/'): string { - const active = (this.currentUrl === path) ? 'active' : ''; - console.log('Route: ' + path + ' Current: ' + this.currentUrl + ' Active?: ' + active); - return active; - } - }