From 27566081972d338784d26d0d393e78389e6379a0 Mon Sep 17 00:00:00 2001 From: mdlufy Date: Wed, 9 Oct 2024 19:54:04 +0300 Subject: [PATCH] fix(addon-doc): `DocDemo` trigger cd manually within zone-free --- projects/addon-doc/components/demo/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/addon-doc/components/demo/index.ts b/projects/addon-doc/components/demo/index.ts index 0e3c13694897..26a8e0f10fef 100644 --- a/projects/addon-doc/components/demo/index.ts +++ b/projects/addon-doc/components/demo/index.ts @@ -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, @@ -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); @@ -126,6 +128,8 @@ export class TuiDocDemo implements AfterViewInit { this.createForm(); this.updateWidth(this.sandboxWidth + this.delta); this.rendered.set(true); + + this.cdr.detectChanges(); }); }