Last change
on this file since d2e69be was d2e69be, checked in by DimitarSlezenkovski <dslezenkovski@…>, 4 years ago |
Add Route Attribute
|
-
Property mode
set to
100644
|
File size:
795 bytes
|
Line | |
---|
1 | import { Component, Inject } from '@angular/core';
|
---|
2 | import { HttpClient } from '@angular/common/http';
|
---|
3 | import { HealthFacilities } from '../models/HealthFacilities';
|
---|
4 | @Component({
|
---|
5 | selector: 'app-counter-component',
|
---|
6 | templateUrl: './counter.component.html',
|
---|
7 | styleUrls: ['./counter.component.css']
|
---|
8 | })
|
---|
9 | export class CounterComponent {
|
---|
10 | public facilities: HealthFacilities[];
|
---|
11 |
|
---|
12 | constructor(http: HttpClient, @Inject('BASE_URL') baseUrl: string) {
|
---|
13 | http.get<HealthFacilities[]>(baseUrl + 'HealthFacilities/Get?').subscribe(result => {
|
---|
14 | this.facilities = result;
|
---|
15 | console.log(this.facilities);
|
---|
16 | }, error => console.error(error));
|
---|
17 | }
|
---|
18 | }
|
---|
19 | /*interface healthFacilities {
|
---|
20 | Name: string;
|
---|
21 | Municipality: string;
|
---|
22 | Address: string;
|
---|
23 | Type: string;
|
---|
24 | Email: string;
|
---|
25 | Phone: string;
|
---|
26 | }*/
|
---|
27 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.