- Timestamp:
- 07/27/20 15:36:14 (3 years ago)
- Branches:
- master
- Children:
- d2e69be
- Parents:
- de2baac
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/ClientApp/src/app/counter/counter.component.ts
rde2baac r4b342bb 1 import { Component } from '@angular/core'; 2 1 import { Component, Inject } from '@angular/core'; 2 import { HttpClient } from '@angular/common/http'; 3 import { HealthFacilities } from '../models/HealthFacilities'; 3 4 @Component({ 4 5 selector: 'app-counter-component', … … 7 8 }) 8 9 export class CounterComponent { 9 public currentCount = 0;10 public facilities: HealthFacilities[]; 10 11 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 } 14 17 }
Note:
See TracChangeset
for help on using the changeset viewer.