import {Resource, Service} from 'ngx-jsonapi';
import {Injectable} from '@angular/core';

@Injectable()

export class ImagesService extends Service<Image> {
  public resource = Image;
  public type = 'images';
}

export class Image extends Resource {
  public attributes: {
    url: string,
    name: string,
  };

  get url(): string {
    // return this.attributes.url + '?' + Date.now();
    return this.attributes.url;
  }

  set url(url: string) {
    this.attributes.url = url;
  }
}
