Update folder structure
This commit is contained in:
17
src/app/service/photoservice.ts
Normal file
17
src/app/service/photoservice.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { Image } from '../api/image';
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user