Last active
October 10, 2017 12:35
-
-
Save evertonrobertoauler/851d79c1e006ca4311948f031a4c8985 to your computer and use it in GitHub Desktop.
universal-demo-v5/src/app/app.component.ts 2
This file contains hidden or 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 { HttpClient } from '@angular/common/http'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.scss'] | |
}) | |
export class AppComponent implements OnInit { | |
title = 'app'; | |
dogs: any; | |
constructor( | |
private http: HttpClient | |
) { } | |
ngOnInit() { | |
this.http | |
.get('https://dog.ceo/api/breeds/list/all') | |
.subscribe(data => { | |
console.log(data); | |
this.dogs = data; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment