Fully generic CRUD pages
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {CrudService} from "./crud.service";
|
||||
import {ApiService} from "./crud.service";
|
||||
import {Observable} from "rxjs";
|
||||
import {Injectable} from "@angular/core";
|
||||
|
||||
@@ -9,12 +9,12 @@ import {Injectable} from "@angular/core";
|
||||
export class JsonschemasService {
|
||||
private rawSchemas: any | null = null;
|
||||
|
||||
constructor(private crudService: CrudService) {}
|
||||
constructor(private apiService: ApiService) {}
|
||||
|
||||
getSchemas(): Observable<Schema> {
|
||||
return new Observable<Schema>((observer) => {
|
||||
if (this.rawSchemas === null) {
|
||||
this.crudService.getSchema().subscribe((jsonSchemas: any) => {
|
||||
this.apiService.getSchema().subscribe((jsonSchemas: any) => {
|
||||
this.rawSchemas = jsonSchemas;
|
||||
observer.next(this.rawSchemas)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user