Advertisement
Guest User

Untitled

a guest
Aug 17th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. import { Component, OnInit } from '@angular/core';
  2. import { FamilyService } from '../family.service';
  3. import { Father } from '../father';
  4. import { Child } from '../child';
  5. import { FATHERS } from '../mock-father';
  6.  
  7.  
  8. @Component({
  9. selector: 'app-fathers-list',
  10. templateUrl: './fathers-list.component.html',
  11. styleUrls: ['./fathers-list.component.css']
  12. })
  13. export class FathersListComponent implements OnInit {
  14.  
  15. fathers = FATHERS;
  16. //fathers: Father[] = [];
  17. selectedFather: Father;
  18. firstName: string = "";
  19. secondName: string = "";
  20. pesel: string = "";
  21. birthDate: string = "";
  22. gender: string = "";
  23.  
  24. constructor(private familyService: FamilyService) {
  25.  
  26. }
  27.  
  28. newChild(): void{
  29. this.child = new Child();
  30. }
  31.  
  32. ngOnInit() {
  33. }
  34.  
  35. onSelect(father: Father): void {
  36. this.selectedFather = father;
  37.  
  38. }
  39.  
  40. searchChild(): void {
  41. this.familyService.findChild(this.firstName, this.secondName, this.pesel, this.birthDate, this.gender).subscribe(data => ddd(data:Data));
  42. }
  43.  
  44. ddd(data: Data){
  45. console.log(data);
  46. }
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement