Guest User

Untitled

a guest
Oct 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. public centers: Center[];
  2.  
  3. constructor(
  4. private _route: ActivatedRoute,
  5. private _router: Router,
  6. private _userService: UserService
  7. ){
  8. this.user = new User("","","","","","","","","","","");
  9. this.title = 'Registrate'
  10. }
  11.  
  12. getCenters(){
  13.  
  14. this._userService.getCenters().subscribe(
  15.  
  16. //Se guardan los centros en un array para poder acceder a ellos desde la plantilla
  17. response => {
  18. this.centers = response;
  19. },
  20. err => {
  21. console.log(err);
  22. }
  23.  
  24. )
  25. }
  26.  
  27. ngOnInit(){
  28.  
  29. this.getCenters();
  30.  
  31. }
Add Comment
Please, Sign In to add comment