From cbb62012df2aa57687267b211d400f1b06f14339 Mon Sep 17 00:00:00 2001 From: Joachim Nielandt Date: Sun, 25 Mar 2018 15:04:09 +0200 Subject: [PATCH] Working on the routing, damnit. --- src/app/app-routing.module.ts | 4 ++-- src/app/services/state.service.ts | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index a75b164..cf9cf4b 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -15,8 +15,8 @@ const appRoutes: Routes = [ {path: 'home', component: HomeComponent}, {path: 'posts', component: PostsComponent}, {path: 'cv', component: CvComponent}, - {path: '', redirectTo: 'home', pathMatch: 'full'}, - {path: '*', redirectTo: 'home', pathMatch: 'full'} + // {path: '', redirectTo: 'home', pathMatch: 'full'}, + // {path: '*', redirectTo: 'home', pathMatch: 'full'} ] } ] diff --git a/src/app/services/state.service.ts b/src/app/services/state.service.ts index b18b8e8..679efcd 100644 --- a/src/app/services/state.service.ts +++ b/src/app/services/state.service.ts @@ -9,8 +9,10 @@ export class StateService { private tagFilter: any = []; private language: string; - constructor() { - + constructor(private router: Router) { + router.events.subscribe(event => { + console.log('stateservice detects a route event!' + event); + }); } // /** @@ -27,6 +29,9 @@ export class StateService { // } shouldDisplay(post: Post): boolean { + + console.log('state service url: ' + this.router.url); + // check whether all filters are true or false: that case, just show everything let foundTrue = false; let foundFalse = false;