export class DownloadsService {

  constructor(
    public $http,
    public $q,
    public API_URL,
    public API_DOWNLOADS_ENDPOINT
  ) {
  }

  public get(): Promise<any> {
    let deferred = this.$q.defer();
    this.$http
        .get(`${this.API_URL}/${this.API_DOWNLOADS_ENDPOINT}`, {
          cache: true
        })
        .then((response) => {
          deferred.resolve(response);
        });
    return deferred.promise;
  }

}
