From ccf6ed16f1eeb05b77103bd44bc06ccbbbba9bdd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 27 May 2016 17:25:52 +0200 Subject: Do not prefix private attributes --- .../app/videos/video-watch/video-watch.component.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'client/app/videos/video-watch') diff --git a/client/app/videos/video-watch/video-watch.component.ts b/client/app/videos/video-watch/video-watch.component.ts index 891e6563f..c159b4004 100644 --- a/client/app/videos/video-watch/video-watch.component.ts +++ b/client/app/videos/video-watch/video-watch.component.ts @@ -23,21 +23,21 @@ export class VideoWatchComponent implements OnInit, CanDeactivate { numPeers: number; loading: boolean = false; - private _interval: NodeJS.Timer; + private interval: NodeJS.Timer; private client: any; constructor( - private _videoService: VideoService, - private _routeParams: RouteParams, - private _elementRef: ElementRef + private videoService: VideoService, + private routeParams: RouteParams, + private elementRef: ElementRef ) { // TODO: use a service this.client = new WebTorrent({ dht: false }); } ngOnInit() { - let id = this._routeParams.get('id'); - this._videoService.getVideo(id).subscribe( + let id = this.routeParams.get('id'); + this.videoService.getVideo(id).subscribe( video => this.loadVideo(video), error => alert(error) ); @@ -50,7 +50,7 @@ export class VideoWatchComponent implements OnInit, CanDeactivate { this.client.add(this.video.magnetUri, (torrent) => { this.loading = false; console.log('Added ' + this.video.magnetUri + '.'); - torrent.files[0].appendTo(this._elementRef.nativeElement.querySelector('.embed-responsive'), (err) => { + torrent.files[0].appendTo(this.elementRef.nativeElement.querySelector('.embed-responsive'), (err) => { if (err) { alert('Cannot append the file.'); console.error(err); @@ -58,7 +58,7 @@ export class VideoWatchComponent implements OnInit, CanDeactivate { }); // Refresh each second - this._interval = setInterval(() => { + this.interval = setInterval(() => { this.downloadSpeed = torrent.downloadSpeed; this.uploadSpeed = torrent.uploadSpeed; this.numPeers = torrent.numPeers; @@ -66,9 +66,9 @@ export class VideoWatchComponent implements OnInit, CanDeactivate { }); } - routerCanDeactivate(next: ComponentInstruction, prev: ComponentInstruction) : any { + routerCanDeactivate(next: ComponentInstruction, prev: ComponentInstruction) { console.log('Removing video from webtorrent.'); - clearInterval(this._interval); + clearInterval(this.interval); this.client.remove(this.video.magnetUri); return true; } -- cgit v1.2.3