Blame view

src/app/component/list-vessel/list-vessel.component.ts 919 Bytes
287033a62   lsagona   add vessel positi...
1
  import {AfterViewInit, Component, OnInit} from '@angular/core';
c4e931730   lsagona   add vessel list
2
  import {VesselsService} from '../../service/vessels.service';
de59ffef8   lsagona   add model + search
3
  import {Vessels} from '../../model/vessels';
287033a62   lsagona   add vessel positi...
4

de59ffef8   lsagona   add model + search
5
  declare var $: any;
632c4ac2f   lsagona   import vessels
6
7
8
9
10
11
12
  
  @Component({
    selector: 'app-list-vessel',
    templateUrl: './list-vessel.component.html',
    styleUrls: ['./list-vessel.component.scss']
  })
  export class ListVesselComponent implements OnInit {
de59ffef8   lsagona   add model + search
13
    vessels: Vessels;
632c4ac2f   lsagona   import vessels
14

c4e931730   lsagona   add vessel list
15
    constructor(private vesselsService: VesselsService) {
632c4ac2f   lsagona   import vessels
16
    }
c4e931730   lsagona   add vessel list
17
18
    ngOnInit(): void {
      this.vesselsService.currentVessels.subscribe(vessels => {
287033a62   lsagona   add vessel positi...
19
20
21
        setTimeout(() =>
          this.vessels = vessels
        );
de59ffef8   lsagona   add model + search
22
23
24
25
26
27
28
29
30
      });
  
      $(document).ready(() => {
        $('#myInput').on('keyup', function(): void {
          const value = $(this).val().toLowerCase();
          $('#list-tab a').filter(function(): void {
            $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
          });
        });
c4e931730   lsagona   add vessel list
31
32
      });
    }
287033a62   lsagona   add vessel positi...
33

632c4ac2f   lsagona   import vessels
34
  }