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

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

parent f1dc7f7d
Branches
1 merge request!38feat: Add option to disable header when current route is play-quiz
Pipeline #301026 passed with stages
in 48 seconds
<app-header></app-header>
<app-header *ngIf="!playQuiz"></app-header>
<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({
selector: 'app-root',
templateUrl: './app.component.html',
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