Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created November 9, 2019 03:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/6877988361a37c05fab12c9b31e2348f to your computer and use it in GitHub Desktop.
Save parzibyte/6877988361a37c05fab12c9b31e2348f to your computer and use it in GitHub Desktop.
import { Component, OnInit } from '@angular/core';
import { MascotasService } from "../mascotas.service"
@Component({
selector: 'app-listar-mascotas',
templateUrl: './listar-mascotas.component.html',
styleUrls: ['./listar-mascotas.component.css']
})
export class ListarMascotasComponent implements OnInit {
constructor(private mascotasService: MascotasService) { }
ngOnInit() {
// Aquí invocamos al servicio:
this.mascotasService.getMascotas().subscribe(data => {
console.log("Los datos: ", data);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment