source:
Farmatiko/ClientApp/src/app/korona/korona.component.ts@
5d02859
Last change on this file since 5d02859 was 5d02859, checked in by , 4 years ago | |
---|---|
|
|
File size: 693 bytes |
Rev | Line | |
---|---|---|
[ee137aa] | 1 | import { Component, OnInit } from '@angular/core'; |
2 | import { DataService } from '../shared/data.service'; | |
3 | import { IPandemic } from '../shared/interfaces'; | |
[ec6ac45] | 4 | |
5 | @Component({ | |
6 | selector: 'app-korona', | |
7 | templateUrl: './korona.component.html', | |
8 | styleUrls: ['./korona.component.css'] | |
9 | }) | |
10 | export class KoronaComponent implements OnInit { | |
[5d02859] | 11 | public korona: IPandemic[]; |
[ee137aa] | 12 | |
13 | constructor(private dataService: DataService) { | |
[ec6ac45] | 14 | |
[de18858] | 15 | } |
[ec6ac45] | 16 | |
17 | ngOnInit(): void { | |
[ee137aa] | 18 | this.dataService.getPandemic() |
[5d02859] | 19 | .subscribe((res: IPandemic[]) => { |
[ee137aa] | 20 | this.korona = res; |
[5d02859] | 21 | console.log(this.korona); |
[ee137aa] | 22 | }, |
23 | (err: any) => console.log(err), | |
24 | () => console.log('Pandemic data retrieved')); | |
[ec6ac45] | 25 | } |
26 | ||
27 | } |
Note:
See TracBrowser
for help on using the repository browser.