From 6aa3a7d863170c754700901048e37dbae4b6ae67 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Wed, 29 Mar 2017 13:29:54 +0300 Subject: [PATCH] fix: view errors were not reported --- lib/components/Redoc/redoc.ts | 2 +- lib/utils/custom-error-handler.ts | 2 +- lib/utils/spec-manager.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/components/Redoc/redoc.ts b/lib/components/Redoc/redoc.ts index db5e3cb555..ec5c248294 100644 --- a/lib/components/Redoc/redoc.ts +++ b/lib/components/Redoc/redoc.ts @@ -101,9 +101,9 @@ export class Redoc extends BaseComponent implements OnInit { if (!spec) { this.appState.startLoading(); } else { + this.specLoaded = true; this.changeDetector.markForCheck(); this.changeDetector.detectChanges(); - this.specLoaded = true; setTimeout(() => { this.hash.start(); }); diff --git a/lib/utils/custom-error-handler.ts b/lib/utils/custom-error-handler.ts index b5cd6fe426..db7684c71f 100644 --- a/lib/utils/custom-error-handler.ts +++ b/lib/utils/custom-error-handler.ts @@ -4,7 +4,7 @@ import { AppStateService } from '../services/app-state.service'; @Injectable() export class CustomErrorHandler extends ErrorHandler { constructor(private appState: AppStateService) { - super(true); + super(); } handleError(error) { this.appState.error.next(error && error.rejection || error); diff --git a/lib/utils/spec-manager.ts b/lib/utils/spec-manager.ts index 6f379d24a8..a98cafb300 100644 --- a/lib/utils/spec-manager.ts +++ b/lib/utils/spec-manager.ts @@ -44,8 +44,8 @@ export class SpecManager { this._schema = snapshot(schema); try { this.init(); - resolve(this._schema); this.spec.next(this._schema); + resolve(this._schema); } catch(err) { reject(err); }