Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. this.caregiverService.getCaregiver(this.id)
  2. .subscribe(data => {
  3. console.log(data)
  4. this.caregiver = data;
  5. for(var i = 0; i < this.caregiver.patients.length; i++){
  6. this.cgs.push(this.caregiver.patients[i]);
  7. }
  8. }, error => console.log(error));
  9.  
  10. <div *ngIf="cgs">
  11. <table class="table table-striped">
  12. <thead>
  13. <tr>
  14. <th>Name</th>
  15. <th>Address</th>
  16. <th>Birthdate</th>
  17. <th>Gender</th>
  18. <th>User type</th>
  19. </tr>
  20. </thead>
  21. <tbody>
  22. <ng-container *ngFor="let caregiverr of cgs">
  23. <tr *ngIf = "caregiver.usertype=='Caregiver'">
  24. <td>{{caregiverr.name}}</td>
  25. <td>{{caregiverr.address}}</td>
  26. <td>{{caregiverr.birthdate}}</td>
  27. <td>{{caregiverr.gender}}</td>
  28. <td>{{caregiverr.usertype}}</td>
  29. </tr>
  30. </ng-container>
  31. </tbody>
  32. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement