Created
November 9, 2019 03:09
-
-
Save parzibyte/6877988361a37c05fab12c9b31e2348f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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