Last change
on this file since de18858 was de18858, checked in by Mile Jankuloski <mile.jankuloski@…>, 5 years ago |
Prepared and improved components for data flows
|
-
Property mode
set to
100644
|
File size:
697 bytes
|
Rev | Line | |
---|
[de18858] | 1 | import { Component, OnInit, Inject } from '@angular/core';
|
---|
| 2 | import { Pandemic } from '../models/Pandemic';
|
---|
| 3 | import { MatTableDataSource } from '@angular/material/table';
|
---|
| 4 | import { HttpClient } from '@angular/common/http';
|
---|
[ec6ac45] | 5 |
|
---|
| 6 | @Component({
|
---|
| 7 | selector: 'app-korona',
|
---|
| 8 | templateUrl: './korona.component.html',
|
---|
| 9 | styleUrls: ['./korona.component.css']
|
---|
| 10 | })
|
---|
| 11 | export class KoronaComponent implements OnInit {
|
---|
[de18858] | 12 | public korona: Pandemic;
|
---|
[ec6ac45] | 13 |
|
---|
[de18858] | 14 | constructor(http: HttpClient, @Inject('BASE_URL') baseUrl: string) {
|
---|
| 15 | http.get<Pandemic>(baseUrl + 'Pandemic/Get?').subscribe(result => {
|
---|
| 16 | this.korona = result;
|
---|
| 17 | console.log(this.korona);
|
---|
| 18 | }, error => console.error(error));
|
---|
| 19 | }
|
---|
[ec6ac45] | 20 |
|
---|
| 21 | ngOnInit(): void {
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.