Working on the routing, damnit.

This commit is contained in:
Joachim Nielandt 2018-03-25 15:04:09 +02:00
parent d03380c9fa
commit cbb62012df
2 changed files with 9 additions and 4 deletions

View File

@ -15,8 +15,8 @@ const appRoutes: Routes = [
{path: 'home', component: HomeComponent}, {path: 'home', component: HomeComponent},
{path: 'posts', component: PostsComponent}, {path: 'posts', component: PostsComponent},
{path: 'cv', component: CvComponent}, {path: 'cv', component: CvComponent},
{path: '', redirectTo: 'home', pathMatch: 'full'}, // {path: '', redirectTo: 'home', pathMatch: 'full'},
{path: '*', redirectTo: 'home', pathMatch: 'full'} // {path: '*', redirectTo: 'home', pathMatch: 'full'}
] ]
} }
] ]

View File

@ -9,8 +9,10 @@ export class StateService {
private tagFilter: any = []; private tagFilter: any = [];
private language: string; 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 { 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 // check whether all filters are true or false: that case, just show everything
let foundTrue = false; let foundTrue = false;
let foundFalse = false; let foundFalse = false;