From 0e354afd209f005f0038f4662d249e8cbcfb2750 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Thu, 28 Jul 2016 19:59:42 +0300 Subject: [PATCH] Fix e2e tests timeouts --- lib/components/JsonSchema/json-schema-lazy.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/components/JsonSchema/json-schema-lazy.ts b/lib/components/JsonSchema/json-schema-lazy.ts index 598e489d..0dbc137a 100644 --- a/lib/components/JsonSchema/json-schema-lazy.ts +++ b/lib/components/JsonSchema/json-schema-lazy.ts @@ -23,9 +23,11 @@ export class JsonSchemaLazy implements OnDestroy, AfterViewInit { @Input() nestOdd: boolean; @Input() childFor: string; @Input() isArray: boolean; + disableLazy: boolean = false; loaded: boolean = false; constructor(private specMgr:SpecManager, private location:ViewContainerRef, private elementRef:ElementRef, private resolver:ComponentResolver, private optionsService:OptionsService, private _renderer: Renderer) { + this.disableLazy = this.optionsService.options.disableLazySchemas; } normalizePointer() { @@ -67,7 +69,7 @@ export class JsonSchemaLazy implements OnDestroy, AfterViewInit { // skip caching view with tabs inside (discriminator) // as it needs attached controller - if (compRef.instance.hasDescendants || compRef.instance._hasSubSchemas) { + if (!this.disableLazy && (compRef.instance.hasDescendants || compRef.instance._hasSubSchemas)) { this._loadAfterSelf(); return; } @@ -85,11 +87,7 @@ export class JsonSchemaLazy implements OnDestroy, AfterViewInit { } ngAfterViewInit() { - if (this.optionsService.options.disableLazySchemas) { - this._loadAfterSelf(); - return; - } - if (!this.auto) return; + if (!this.auto && !this.disableLazy) return; this.loadCached(); }