Last change
on this file since 4b342bb was 4b342bb, checked in by Mile Jankuloski <mile.jankuloski@…>, 4 years ago |
Connecting front to back
|
-
Property mode
set to
100644
|
File size:
609 bytes
|
Rev | Line | |
---|
[4b342bb] | 1 | import { Component, Inject } from '@angular/core';
|
---|
| 2 | import { HttpClient } from '@angular/common/http';
|
---|
| 3 | import { HealthFacilities } from '../models/HealthFacilities';
|
---|
[30a465f] | 4 | @Component({
|
---|
| 5 | selector: 'app-counter-component',
|
---|
[ec6ac45] | 6 | templateUrl: './counter.component.html',
|
---|
| 7 | styleUrls: ['./counter.component.css']
|
---|
[30a465f] | 8 | })
|
---|
| 9 | export class CounterComponent {
|
---|
[4b342bb] | 10 | public facilities: HealthFacilities[];
|
---|
[30a465f] | 11 |
|
---|
[4b342bb] | 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.