UNPKG

@igo2/common

Version:
66 lines (61 loc) 2.4 kB
import * as i0 from '@angular/core'; import { Injectable, NgModule } from '@angular/core'; import * as i1 from '@angular/common/http'; import { throwError } from 'rxjs'; import { map, catchError } from 'rxjs/operators'; class DOMService { http; constructor(http) { this.http = http; } async getDomValuesFromURL(domOptions) { const url = domOptions.url; let result; await this.http .get(url) .pipe(map((response) => { result = response; return response; }), catchError((err) => { return throwError(err); })) .toPromise(); return result; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DOMService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DOMService, providedIn: 'root' }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DOMService, decorators: [{ type: Injectable, args: [{ providedIn: 'root' }] }], ctorParameters: () => [{ type: i1.HttpClient }] }); /** * @deprecated it has no effect */ class IgoDOMModule { /** * @deprecated it has no effect */ static forRoot() { return { ngModule: IgoDOMModule, providers: [DOMService] }; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IgoDOMModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: IgoDOMModule }); static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IgoDOMModule, providers: [DOMService] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IgoDOMModule, decorators: [{ type: NgModule, args: [{ providers: [DOMService] }] }] }); /** * Generated bundle index. Do not edit. */ export { DOMService, IgoDOMModule }; //# sourceMappingURL=igo2-common-dom.mjs.map