Ignore:
Timestamp:
07/27/20 15:36:14 (2 years ago)
Author:
Mile Jankuloski <mile.jankuloski@…>
Branches:
master
Children:
d2e69be
Parents:
de2baac
Message:

Connecting front to back

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Farmatiko/ClientApp/src/app/counter/counter.component.ts

    rde2baac r4b342bb  
    1 import { Component } from '@angular/core';
    2 
     1import { Component, Inject } from '@angular/core';
     2import { HttpClient } from '@angular/common/http';
     3import { HealthFacilities } from '../models/HealthFacilities';
    34@Component({
    45  selector: 'app-counter-component',
     
    78})
    89export class CounterComponent {
    9   public currentCount = 0;
     10  public facilities: HealthFacilities[];
    1011
    11   public incrementCounter() {
    12     this.currentCount++;
    13   }
     12  constructor(http: HttpClient, @Inject('BASE_URL') baseUrl: string) {
     13    http.get<HealthFacilities[]>(baseUrl + 'HealthFacilities').subscribe(result => {
     14      this.facilities = result;
     15    }, error => console.error(error));
     16  }
    1417}
Note: See TracChangeset for help on using the changeset viewer.