Skip to content

Commit

Permalink
fix(addon-doc): DocDemo trigger cd manually within zone-free
Browse files Browse the repository at this point in the history
  • Loading branch information
mdlufy committed Oct 9, 2024
1 parent ca8b558 commit 2756608
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions projects/addon-doc/components/demo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {JsonPipe, Location, NgIf, NgTemplateOutlet} from '@angular/common';
import type {AfterViewInit, ElementRef} from '@angular/core';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
computed,
ContentChild,
Expand Down Expand Up @@ -80,6 +81,7 @@ export class TuiDocDemo implements AfterViewInit {

private readonly el = tuiInjectElement();
private readonly destroyRef = inject(DestroyRef);
private readonly cdr = inject(ChangeDetectorRef);
private readonly ngZone = inject(NgZone);
private readonly locationRef = inject(Location);
private readonly urlSerializer = inject(UrlSerializer);
Expand Down Expand Up @@ -126,6 +128,8 @@ export class TuiDocDemo implements AfterViewInit {
this.createForm();
this.updateWidth(this.sandboxWidth + this.delta);
this.rendered.set(true);

this.cdr.detectChanges();
});
}

Expand Down

0 comments on commit 2756608

Please sign in to comment.