Use native angular way of accessing HTML elements
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ChangeDetectionStrategy, Component, Inject, LOCALE_ID, OnInit } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, ElementRef, Inject, LOCALE_ID, OnInit, ViewChild } from '@angular/core';
|
||||
import { WebsocketService } from '../../services/websocket.service';
|
||||
import { SeoService } from '../../services/seo.service';
|
||||
import { StateService } from '../../services/state.service';
|
||||
@@ -17,6 +17,7 @@ import { DOCUMENT } from '@angular/common';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class AboutComponent implements OnInit {
|
||||
@ViewChild('promoVideo') promoVideo: ElementRef;
|
||||
backendInfo$: Observable<IBackendInfo>;
|
||||
sponsors$: Observable<any>;
|
||||
translators$: Observable<ITranslators>;
|
||||
@@ -91,12 +92,11 @@ export class AboutComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
showSubtitles(language) {
|
||||
showSubtitles(language): boolean {
|
||||
return ( this.locale.startsWith( language ) && !this.locale.startsWith('en') );
|
||||
}
|
||||
|
||||
unmutePromoVideo() {
|
||||
let video = <HTMLVideoElement>this.document.getElementById('promoVideo');
|
||||
video.muted = false;
|
||||
unmutePromoVideo(): void {
|
||||
this.promoVideo.nativeElement.muted = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user