Update folder structure

This commit is contained in:
Çetin
2021-12-28 13:29:25 +03:00
parent e0762fdeb0
commit ab8f627bb3
71 changed files with 189 additions and 193 deletions

View File

@@ -0,0 +1,20 @@
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';
@Injectable()
export class MenuService {
private menuSource = new Subject<string>();
private resetSource = new Subject();
menuSource$ = this.menuSource.asObservable();
resetSource$ = this.resetSource.asObservable();
onMenuStateChange(key: string) {
this.menuSource.next(key);
}
reset() {
// this.resetSource.next(true);
}
}

View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
@Injectable()
export class CountryService {
constructor(private http: HttpClient) { }
getCountries() {
return this.http.get<any>('assets/demo/data/countries.json')
.toPromise()
.then(res => res.data as any[])
.then(data => data);
}
}

View File

@@ -0,0 +1,31 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Customer } from '../api/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);
}
}

15
src/app/service/eventservice.ts Executable file
View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
@Injectable()
export class EventService {
constructor(private http: HttpClient) { }
getEvents() {
return this.http.get<any>('assets/demo/data/scheduleevents.json')
.toPromise()
.then(res => res.data as any[])
.then(data => data);
}
}

22
src/app/service/iconservice.ts Executable file
View File

@@ -0,0 +1,22 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import {map} from 'rxjs/operators';
@Injectable()
export class IconService {
constructor(private http: HttpClient) { }
icons: any[];
selectedIcon: any;
apiUrl = 'assets/demo/data/icons.json';
getIcons() {
return this.http.get(this.apiUrl).pipe(map((response: any) => {
this.icons = response.icons;
return this.icons;
}));
}
}

34
src/app/service/nodeservice.ts Executable file
View File

@@ -0,0 +1,34 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { TreeNode } from 'primeng/api';
@Injectable()
export class NodeService {
constructor(private http: HttpClient) { }
getFiles() {
return this.http.get<any>('assets/demo/data/files.json')
.toPromise()
.then(res => res.data as TreeNode[]);
}
getLazyFiles() {
return this.http.get<any>('assets/demo/data/files-lazy.json')
.toPromise()
.then(res => res.data as TreeNode[]);
}
getFilesystem() {
return this.http.get<any>('assets/demo/data/filesystem.json')
.toPromise()
.then(res => res.data as TreeNode[]);
}
getLazyFilesystem() {
return this.http.get<any>('assets/demo/data/filesystem-lazy.json')
.toPromise()
.then(res => res.data as TreeNode[]);
}
}

View 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);
}
}

View File

@@ -0,0 +1,38 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Product } from '../api/product';
@Injectable()
export class ProductService {
constructor(private http: HttpClient) { }
getProductsSmall() {
return this.http.get<any>('assets/demo/data/products-small.json')
.toPromise()
.then(res => res.data as Product[])
.then(data => data);
}
getProducts() {
return this.http.get<any>('assets/demo/data/products.json')
.toPromise()
.then(res => res.data as Product[])
.then(data => data);
}
getProductsMixed() {
return this.http.get<any>('assets/demo/data/products-mixed.json')
.toPromise()
.then(res => res.data as Product[])
.then(data => data);
}
getProductsWithOrdersSmall() {
return this.http.get<any>('assets/demo/data/products-orders-small.json')
.toPromise()
.then(res => res.data as Product[])
.then(data => data);
}
}