Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | 1x 1x 1x 1x 1x 1x 11x 11x 11x 11x 11x 11x 11x 11x 1331x 594x 737x 737x 737x | import { Component, OnInit } from '@angular/core'; import { AngularFirestore } from '@angular/fire/firestore'; import { ActivatedRoute, Router } from '@angular/router'; import { Observable } from 'rxjs'; import { JokeModel } from '../../models'; import { AlertService, PageService, SeoService } from '../../services'; /** * Joke Detail Component */ @Component({ selector: 'app-joke-detail', templateUrl: './joke-detail.component.html' }) export class JokeDetailComponent implements OnInit { /** current joke object */ joke$: Observable<JokeModel>; /** current joke id */ jokeID = ''; /** * constructor of JokeDetailComponent * @param afs: AngularFirestore * @param seo: SeoService * @param alert: AlertService * @param router: Router * @param route: ActivatedRoute * @param pageService: PageService */ constructor( private readonly afs: AngularFirestore, private readonly seo: SeoService, private readonly alert: AlertService, public router: Router, private readonly route: ActivatedRoute, public pageService: PageService ) { } /** * ngOnInit */ ngOnInit(): void { this.route.paramMap.subscribe(pmap => { if (this.pageService.checkToRedirectByIDParam(pmap, 'jokes', this.pageService.routerLinks.jokes, this.pageService.routerLinks.joke)) { return; } this.jokeID = pmap.get('id'); this.initJoke(); }); } /** * init joke */ initJoke(): void { this.joke$ = this.pageService.getPageFromFirestore(JokeModel, 'jokes', this.jokeID); } } |