- Timestamp:
- 07/27/20 15:36:14 (4 years ago)
- Branches:
- master
- Children:
- d2e69be
- Parents:
- de2baac
- Location:
- Farmatiko/ClientApp/src
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/ClientApp/src/app/counter/counter.component.html
rde2baac r4b342bb 1 <!-- <h1>Counter</h1>2 3 <p>This is a simple example of an Angular component.</p>4 5 <p aria-live="polite">Current count: <strong>{{ currentCount }}</strong></p>6 7 <button class="btn btn-primary" (click)="incrementCounter()">Increment</button> -->8 9 1 <app-nav-menu></app-nav-menu> 10 2 … … 13 5 <h2>Здравствени установи</h2> 14 6 <input type="text" class="form-control" name="lek" placeholder="Пронајди лек"> 15 <table class='table table-striped table-bordered table-sm' cellspacing="0" width="100%" aria-labelledby="tableLabel" *ngIf=" true">7 <table class='table table-striped table-bordered table-sm' cellspacing="0" width="100%" aria-labelledby="tableLabel" *ngIf="facilities"> 16 8 <thead> 17 9 <tr> 18 <th>Placeholder1</th> 19 <th>Placeholder2</th> 20 <th>Placeholder3</th> 21 <th>Placeholder4</th> 10 <th>Име</th> 11 <th>Општина</th> 12 <th>Адреса</th> 13 <th>Тип на установа</th> 14 <th>Е-пошта</th> 15 <th>Телефон</th> 22 16 </tr> 23 17 </thead> 24 18 <tbody> 25 <tr *ngFor=""> 26 <td>data1</td> 27 <td>data2</td> 28 <td>data3</td> 29 <td>data4</td> 19 <tr *ngFor="let facility of facilities"> 20 <td>{{ facility.Name }}</td> 21 <td>{{ facility.Municipality }}</td> 22 <td>{{ facility.Address }}</td> 23 <td>{{ facility.Type }}</td> 24 <td>{{ facility.Email }}</td> 25 <td>{{ facility.Phone }}</td> 30 26 </tr> 31 27 </tbody> -
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.