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
|
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) {
|
---|
[d2e69be] | 13 | http.get<HealthFacilities[]>(baseUrl + 'HealthFacilities/Get?').subscribe(result => {
|
---|
[4b342bb] | 14 | this.facilities = result;
|
---|
[d2e69be] | 15 | console.log(this.facilities);
|
---|
[4b342bb] | 16 | }, error => console.error(error));
|
---|
[d2e69be] | 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.