diff --git a/OpenAlprWebhookProcessor/angularapp/src/app/plates/plate/plate.component.ts b/OpenAlprWebhookProcessor/angularapp/src/app/plates/plate/plate.component.ts index 8ed17602..bd1e8997 100644 --- a/OpenAlprWebhookProcessor/angularapp/src/app/plates/plate/plate.component.ts +++ b/OpenAlprWebhookProcessor/angularapp/src/app/plates/plate/plate.component.ts @@ -1,5 +1,5 @@ import { DatePipe } from '@angular/common'; -import { Component, Input, OnDestroy, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { SnackbarService } from 'app/snackbar/snackbar.service'; import { SnackBarType } from 'app/snackbar/snackbartype'; import { Lightbox } from 'ngx-lightbox'; @@ -7,14 +7,13 @@ import { Url } from 'url'; import { PlateService } from '../plate.service'; import { Plate } from './plate'; import { PlateStatisticsData } from './plateStatistics'; -import { Subscription } from 'rxjs'; @Component({ selector: 'app-plate', templateUrl: './plate.component.html', styleUrls: ['./plate.component.less'] }) -export class PlateComponent implements OnInit, OnDestroy { +export class PlateComponent implements OnInit { @Input() plate: Plate; public loadingImage: boolean; @@ -28,8 +27,6 @@ export class PlateComponent implements OnInit, OnDestroy { public plateStatistics: PlateStatisticsData[] = []; public displayedColumns: string[] = ['key', 'value']; - private statisticsSubscription = new Subscription(); - constructor( private lightbox: Lightbox, private plateService: PlateService, @@ -43,13 +40,9 @@ export class PlateComponent implements OnInit, OnDestroy { this.getPlateStatistics(); } - ngOnDestroy(): void { - this.statisticsSubscription.unsubscribe(); - } - private getPlateStatistics() { this.loadingStatistics = true; - this.statisticsSubscription = this.plateService.getPlateStatistics(this.plate.plateNumber).subscribe(result => { + this.plateService.getPlateStatistics(this.plate.plateNumber).subscribe(result => { this.loadingStatistics = false; this.plateStatistics.push({ key: "Confidence",