Skip to content

Commit

Permalink
this too
Browse files Browse the repository at this point in the history
  • Loading branch information
mlapaglia committed Oct 30, 2023
1 parent 09af4a9 commit 9ec1b27
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
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';
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;
Expand All @@ -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,
Expand All @@ -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",
Expand Down

0 comments on commit 9ec1b27

Please sign in to comment.