Skip to content
Snippets Groups Projects
Commit 2de27c8b authored by HUSS THEOPHILE's avatar HUSS THEOPHILE
Browse files

:twisted_rightwards_arrows: merge feat: Add option to disable header when current route is play-quiz

Merge branch 'feature/34-disable-header-on-play-quiz-page' into 'develop'
parents 146c1fef d90b2646
Branches
1 merge request!38feat: Add option to disable header when current route is play-quiz
Pipeline #302244 passed with stages
in 1 minute and 50 seconds
<app-header></app-header> <app-header *ngIf="!playQuiz"></app-header>
<router-outlet></router-outlet> <router-outlet></router-outlet>
import { Component } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, ActivatedRouteSnapshot, NavigationEnd, Router } from '@angular/router';
import { filter } from 'rxjs';
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
templateUrl: './app.component.html', templateUrl: './app.component.html',
styleUrl: './app.component.css', styleUrl: './app.component.css',
}) })
export class AppComponent {} export class AppComponent implements OnInit {
playQuiz: boolean = false;
constructor(private router: Router, private route: ActivatedRoute) {}
ngOnInit(): void {
this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe(() => {
this.playQuiz = this.router.url.includes('play-quiz');
});
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment