Last active
November 10, 2019 23:02
-
-
Save parzibyte/03a6671e735657a946982489536347d7 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
// Importar servicio y también clase: | |
import { PersonasService } from "./personas.service"; | |
import {Persona} from "./persona" | |
export class AppComponent { | |
// Inyectar servicio en constructor | |
constructor(private personasService: PersonasService) {} | |
// Función que hace la petición | |
probarGet() { | |
this.personasService | |
.obtener() | |
.subscribe((personas: Persona[]) => { | |
console.log(personas); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment