Skip to content

Instantly share code, notes, and snippets.

@daviddt
Created August 20, 2015 12:52
Show Gist options
  • Save daviddt/ee2daa382bd4e431d54b to your computer and use it in GitHub Desktop.
Save daviddt/ee2daa382bd4e431d54b to your computer and use it in GitHub Desktop.
/// <reference path="../../typings/_custom.d.ts" />
import { Injectable } from 'angular2/angular2';
@Injectable()
export class Spotify {
url: string;
constructor() {
this.url = 'https://api.spotify.com/v1/';
}
public searchArtist (value) {
return window.fetch(this.url + 'search?type=artist&q=' + value);
}
public getArtistById (id) {
return window.fetch(this.url + 'artists/' + id);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment