Fixed imports due to refactoring
This commit is contained in:
parent
f18fe6b9de
commit
21a2ff9195
|
@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Observable, of } from 'rxjs';
|
import { Observable, of } from 'rxjs';
|
||||||
import { catchError } from 'rxjs/operators';
|
import { catchError } from 'rxjs/operators';
|
||||||
import { ISType } from './ISType';
|
import { TypeDefinition } from './is-model/types/TypeDefinition';
|
||||||
import { types } from './types';
|
import { types } from './types';
|
||||||
import { list } from './list';
|
import { list } from './list';
|
||||||
|
|
||||||
|
@ -39,12 +39,12 @@ export class IsService {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public getResourceTypes(callback: (isTypes: ISType[]) => void): void {
|
public getResourceTypes(callback: (isTypes: TypeDefinition[]) => void): void {
|
||||||
const url = this.typesURL + '/Resource?polymorphic=true&gcube-token=' + this.token;
|
const url = this.typesURL + '/Resource?polymorphic=true&gcube-token=' + this.token;
|
||||||
// const observable: Observable<ISType[]> = of(types);
|
// const observable: Observable<ISType[]> = of(types);
|
||||||
const observable: Observable<ISType[]> = this.httpClient.get<ISType[]>(url);
|
const observable: Observable<TypeDefinition[]> = this.httpClient.get<TypeDefinition[]>(url);
|
||||||
observable.pipe(
|
observable.pipe(
|
||||||
catchError(this.handleError<ISType[]>('getResourceTypes()', types))
|
catchError(this.handleError<TypeDefinition[]>('getResourceTypes()', types))
|
||||||
).subscribe(data => callback(data));
|
).subscribe(data => callback(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue