Skip to content

Instantly share code, notes, and snippets.

@yoelnacho
Created April 2, 2017 22:38
Show Gist options
  • Save yoelnacho/8906a2cacdab489215d7350813f9f79a to your computer and use it in GitHub Desktop.
Save yoelnacho/8906a2cacdab489215d7350813f9f79a to your computer and use it in GitHub Desktop.
Angular2: Service - simple get id
urlArtista:string = "https://api.spotify.com/v1/artists";
getArtista( id:string ){
let query = `/${ id }`;
let url = this.urlArtista + query;
return this.http.get( url )
.map( res =>{
console.log( res.json() );
return res.json();
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment