Blame view

src/app/service/selected-vessel.service.ts 494 Bytes
9bbae2409   lsagona   highlight selecte...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  import { Injectable } from '@angular/core';
  import {BehaviorSubject} from 'rxjs';
  import {Vessel} from '../model/vessel';
  import {Message} from '../model/message';
  
  @Injectable({
    providedIn: 'root'
  })
  export class SelectedVesselService {
    private selectedVessel = new BehaviorSubject(new Vessel(new Array<Message>()));
    currentVessel = this.selectedVessel.asObservable();
  
    constructor() {
    }
  
    changeVesselSet(newVessels: Vessel): void {
      this.selectedVessel.next(newVessels);
    }
  }