- Timestamp:
- 07/29/20 19:46:21 (5 years ago)
- Branches:
- master
- Children:
- 4e72684
- Parents:
- e42f61a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/ClientApp/src/app/korona/korona.component.ts
re42f61a rde18858 1 import { Component, OnInit } from '@angular/core'; 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'; 2 5 3 6 @Component({ … … 7 10 }) 8 11 export class KoronaComponent implements OnInit { 12 public korona: Pandemic; 9 13 10 constructor() { } 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 } 11 20 12 21 ngOnInit(): void {
Note:
See TracChangeset
for help on using the changeset viewer.