nx-primeng-sakai-v17/src/app/service/photoservice.ts

18 lines
399 B
TypeScript
Raw Normal View History

2021-12-09 14:24:42 +00:00
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
2021-12-28 10:29:25 +00:00
import { Image } from '../api/image';
2021-12-09 14:24:42 +00:00
@Injectable()
export class PhotoService {
constructor(private http: HttpClient) { }
getImages() {
return this.http.get<any>('assets/demo/data/photos.json')
.toPromise()
.then(res => res.data as Image[])
.then(data => data);
}
}