source: Farmatiko/ClientApp/src/app/counter/counter.component.ts@ 4b342bb

Last change on this file since 4b342bb was 4b342bb, checked in by Mile Jankuloski <mile.jankuloski@…>, 2 years ago

Connecting front to back

  • Property mode set to 100644
File size: 609 bytes
Line 
1import { Component, Inject } from '@angular/core';
2import { HttpClient } from '@angular/common/http';
3import { HealthFacilities } from '../models/HealthFacilities';
4@Component({
5 selector: 'app-counter-component',
6 templateUrl: './counter.component.html',
7 styleUrls: ['./counter.component.css']
8})
9export class CounterComponent {
10 public facilities: HealthFacilities[];
11
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 }
17}
Note: See TracBrowser for help on using the repository browser.