Skip to content

Commit cd6232d

Browse files
authored
Merge pull request #147 from markdBC/table-layout
Explicitly invoke change detection after component creation
2 parents 12222ad + 86be8e4 commit cd6232d

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/ui-scroll.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,7 @@ export class UiScrollComponent implements OnInit, OnDestroy {
8181
constructor(
8282
public changeDetector: ChangeDetectorRef,
8383
public elementRef: ElementRef
84-
) {
85-
setTimeout(() => this.ngOnInit()); // 😢
86-
}
84+
) { }
8785

8886
ngOnInit() {
8987
this.workflow = new Workflow(

src/ui-scroll.directive.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ export class UiScrollDirective implements OnInit {
3434
componentRef.instance.version = version;
3535
componentRef.instance.parentElement = this.templateRef.elementRef.nativeElement.parentElement;
3636
this.viewContainer.createEmbeddedView(componentRef.instance.uiScrollTemplateRef);
37+
componentRef.changeDetectorRef.detectChanges();
3738
}
3839
}

0 commit comments

Comments
 (0)