Skip to content

Instantly share code, notes, and snippets.

@Hitman666
Created September 16, 2016 09:42
Show Gist options
  • Save Hitman666/795939ab27acd16c5be1d0ba13586108 to your computer and use it in GitHub Desktop.
Save Hitman666/795939ab27acd16c5be1d0ba13586108 to your computer and use it in GitHub Desktop.
import { Component } from '@angular/core';
import { Http, Response } from '@angular/http';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app works!';
constructor(private http: Http){
let link = 'http://api.giphy.com/v1/gifs/search?api_key=dc6zaTOxFJmzC&q=';
let apiLink = link + 'cats';
this.http.request(apiLink).subscribe((res: Response) => {
console.log(res.json());
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment