mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-03-06 22:00:16 +01:00
29 lines
752 B
TypeScript
29 lines
752 B
TypeScript
|
|
import { Injectable } from '@angular/core';
|
||
|
|
import { of as observableOf, Observable } from 'rxjs';
|
||
|
|
|
||
|
|
@Injectable()
|
||
|
|
export class CountryOrderService {
|
||
|
|
|
||
|
|
private countriesCategories = [
|
||
|
|
'Sofas',
|
||
|
|
'Furniture',
|
||
|
|
'Lighting',
|
||
|
|
'Tables',
|
||
|
|
'Textiles',
|
||
|
|
];
|
||
|
|
private countriesCategoriesLength = this.countriesCategories.length;
|
||
|
|
private generateRandomData(nPoints: number): number[] {
|
||
|
|
return Array.from(Array(nPoints)).map(() => {
|
||
|
|
return Math.round(Math.random() * 20);
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
getCountriesCategories(): Observable<string[]> {
|
||
|
|
return observableOf(this.countriesCategories);
|
||
|
|
}
|
||
|
|
|
||
|
|
getCountriesCategoriesData(): Observable<number[]> {
|
||
|
|
return observableOf(this.generateRandomData(this.countriesCategoriesLength));
|
||
|
|
}
|
||
|
|
}
|