nx-primeng-sakai-v17/src/app/demo/service/customerservice.ts
Cetin Cakiroglu 89b1bf58fa add template
2021-12-09 17:24:42 +03:00

32 lines
885 B
TypeScript

import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Customer } from '../domain/customer';
@Injectable()
export class CustomerService {
constructor(private http: HttpClient) { }
getCustomersSmall() {
return this.http.get<any>('assets/demo/data/customers-small.json')
.toPromise()
.then(res => res.data as Customer[])
.then(data => data);
}
getCustomersMedium() {
return this.http.get<any>('assets/demo/data/customers-medium.json')
.toPromise()
.then(res => res.data as Customer[])
.then(data => data);
}
getCustomersLarge() {
return this.http.get<any>('assets/demo/data/customers-large.json')
.toPromise()
.then(res => res.data as Customer[])
.then(data => data);
}
}