Changeset ee137aa for Farmatiko/ClientApp/src/app/korona
- Timestamp:
- 08/07/20 10:59:56 (4 years ago)
- Branches:
- master
- Children:
- 63d885e
- Parents:
- c73269d
- Location:
- Farmatiko/ClientApp/src/app/korona
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/ClientApp/src/app/korona/korona.component.html
rc73269d ree137aa 12 12 <div class="col"> 13 13 <div class="counter"> 14 <i class="fa fa-code fa-2x" *ngIf="korona">{{korona [0].totalMK}}</i>14 <i class="fa fa-code fa-2x" *ngIf="korona">{{korona.totalMK}}</i> 15 15 <h2 class="timer count-title count-number"></h2> 16 16 <p class="count-text ">Вкупно случаи во земјата</p> … … 19 19 <div class="col"> 20 20 <div class="counter"> 21 <i class="fa fa-coffee fa-2x" *ngIf="korona">{{korona [0].activeMK}}</i>21 <i class="fa fa-coffee fa-2x" *ngIf="korona">{{korona.activeMK}}</i> 22 22 <h2 class="timer count-title count-number"></h2> 23 23 <p class="count-text ">Активни случаи во земјата</p> … … 26 26 <div class="col"> 27 27 <div class="counter"> 28 <i class="fa fa-lightbulb-o fa-2x" *ngIf="korona">{{korona [0].deathsMK}}</i>28 <i class="fa fa-lightbulb-o fa-2x" *ngIf="korona">{{korona.deathsMK}}</i> 29 29 <h2 class="timer count-title count-number"></h2> 30 30 <p class="count-text ">Смртни случаи во земјата</p> … … 33 33 <div class="col"> 34 34 <div class="counter"> 35 <i class="fa fa-bug fa-2x" *ngIf="korona">{{korona [0].newMK}}</i>35 <i class="fa fa-bug fa-2x" *ngIf="korona">{{korona.newMK}}</i> 36 36 <h2 class="timer count-title count-number"></h2> 37 37 <p class="count-text ">Нови случаи во земјата</p> … … 42 42 <div class="col"> 43 43 <div class="counter"> 44 <i class="fa fa-bug fa-2x" *ngIf="korona">{{korona [0].totalGlobal}}</i>44 <i class="fa fa-bug fa-2x" *ngIf="korona">{{korona.totalGlobal}}</i> 45 45 <h2 class="timer count-title count-number"></h2> 46 46 <p class="count-text ">Вкупно случаи глобално</p> … … 49 49 <div class="col"> 50 50 <div class="counter"> 51 <i class="fa fa-bug fa-2x" *ngIf="korona">{{korona [0].activeGlobal}}</i>51 <i class="fa fa-bug fa-2x" *ngIf="korona">{{korona.activeGlobal}}</i> 52 52 <h2 class="timer count-title count-number"></h2> 53 53 <p class="count-text ">Активни случаи глобално</p> … … 56 56 <div class="col"> 57 57 <div class="counter"> 58 <i class="fa fa-bug fa-2x" *ngIf="korona">{{korona [0].deathsGlobal}}</i>58 <i class="fa fa-bug fa-2x" *ngIf="korona">{{korona.deathsGlobal}}</i> 59 59 <h2 class="timer count-title count-number"></h2> 60 60 <p class="count-text ">Смртни случаи глобално</p> -
Farmatiko/ClientApp/src/app/korona/korona.component.ts
rc73269d ree137aa 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'; 1 import { Component, OnInit } from '@angular/core'; 2 import { DataService } from '../shared/data.service'; 3 import { IPandemic } from '../shared/interfaces'; 5 4 6 5 @Component({ … … 10 9 }) 11 10 export class KoronaComponent implements OnInit { 12 public korona: Pandemic[];11 public korona: IPandemic; 13 12 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)); 13 constructor(private dataService: DataService) { 14 19 15 } 20 16 21 17 ngOnInit(): void { 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')); 22 24 } 23 25
Note:
See TracChangeset
for help on using the changeset viewer.