Blame view

src/app/component/list-vessel/list-vessel.component.ts 603 Bytes
c4e931730   lsagona   add vessel list
1
2
3
  import {Component, OnInit} from '@angular/core';
  import {Vessel} from '../../model/vessel';
  import {VesselsService} from '../../service/vessels.service';
632c4ac2f   lsagona   import vessels
4
5
6
7
8
9
10
  
  @Component({
    selector: 'app-list-vessel',
    templateUrl: './list-vessel.component.html',
    styleUrls: ['./list-vessel.component.scss']
  })
  export class ListVesselComponent implements OnInit {
c4e931730   lsagona   add vessel list
11
    vessels: Map<number, Vessel>;
632c4ac2f   lsagona   import vessels
12

632c4ac2f   lsagona   import vessels
13

c4e931730   lsagona   add vessel list
14
    constructor(private vesselsService: VesselsService) {
632c4ac2f   lsagona   import vessels
15
    }
c4e931730   lsagona   add vessel list
16
17
18
19
20
21
    ngOnInit(): void {
      this.vesselsService.currentVessels.subscribe(vessels => {
        this.vessels = vessels;
        console.log(this.vessels);
      });
    }
632c4ac2f   lsagona   import vessels
22
  }