diff --git a/src/ui-scroll.component.ts b/src/ui-scroll.component.ts index c5ccda8e..3bb4cfc8 100644 --- a/src/ui-scroll.component.ts +++ b/src/ui-scroll.component.ts @@ -81,9 +81,7 @@ export class UiScrollComponent implements OnInit, OnDestroy { constructor( public changeDetector: ChangeDetectorRef, public elementRef: ElementRef - ) { - setTimeout(() => this.ngOnInit()); // 😢 - } + ) { } ngOnInit() { this.workflow = new Workflow( diff --git a/src/ui-scroll.directive.ts b/src/ui-scroll.directive.ts index 60a58362..f51ceba6 100644 --- a/src/ui-scroll.directive.ts +++ b/src/ui-scroll.directive.ts @@ -34,5 +34,6 @@ export class UiScrollDirective implements OnInit { componentRef.instance.version = version; componentRef.instance.parentElement = this.templateRef.elementRef.nativeElement.parentElement; this.viewContainer.createEmbeddedView(componentRef.instance.uiScrollTemplateRef); + componentRef.changeDetectorRef.detectChanges(); } }