Last change
on this file since c406ae5 was d8fafb8, checked in by DimitarSlezenkovski <dslezenkovski@…>, 4 years ago |
Prototype N1
|
-
Property mode
set to
100644
|
File size:
700 bytes
|
Line | |
---|
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';
|
---|
5 |
|
---|
6 | @Component({
|
---|
7 | selector: 'app-korona',
|
---|
8 | templateUrl: './korona.component.html',
|
---|
9 | styleUrls: ['./korona.component.css']
|
---|
10 | })
|
---|
11 | export class KoronaComponent implements OnInit {
|
---|
12 | public korona: Pandemic[];
|
---|
13 |
|
---|
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 | }
|
---|
20 |
|
---|
21 | ngOnInit(): void {
|
---|
22 | }
|
---|
23 |
|
---|
24 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.