source: Farmatiko/ClientApp/src/app/korona/korona.component.ts@ 63d885e

Last change on this file since 63d885e was ee137aa, checked in by Mile Jankuloski <mile.jankuloski@…>, 4 years ago

Added DataService and dialogs, all bindings needed implemented

  • Property mode set to 100644
File size: 653 bytes
RevLine 
[ee137aa]1import { Component, OnInit } from '@angular/core';
2import { DataService } from '../shared/data.service';
3import { IPandemic } from '../shared/interfaces';
[ec6ac45]4
5@Component({
6 selector: 'app-korona',
7 templateUrl: './korona.component.html',
8 styleUrls: ['./korona.component.css']
9})
10export class KoronaComponent implements OnInit {
[ee137aa]11 public korona: IPandemic;
12
13 constructor(private dataService: DataService) {
[ec6ac45]14
[de18858]15 }
[ec6ac45]16
17 ngOnInit(): void {
[ee137aa]18 this.dataService.getPandemic()
19 .subscribe((res: IPandemic) => {
20 this.korona = res;
21 },
22 (err: any) => console.log(err),
23 () => console.log('Pandemic data retrieved'));
[ec6ac45]24 }
25
26}
Note: See TracBrowser for help on using the repository browser.