From 64263f8e7d3e24093b1d73faebdd0d574d2bd77a Mon Sep 17 00:00:00 2001 From: cipchk Date: Mon, 18 Mar 2024 14:28:16 +0800 Subject: [PATCH] docs: update --- packages/abc/cell/cell.service.ts | 4 ++-- packages/abc/cell/demo/simple.md | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/abc/cell/cell.service.ts b/packages/abc/cell/cell.service.ts index 2bf278c54..2210a5059 100644 --- a/packages/abc/cell/cell.service.ts +++ b/packages/abc/cell/cell.service.ts @@ -78,8 +78,8 @@ export class CellService { this.widgets[key] = { type: 'widget', ref: widget }; } - getWidget(key?: string): CellWidget | undefined { - return key ? this.widgets[key] : undefined; + getWidget(key: string): CellWidget | undefined { + return this.widgets[key]; } private genType(value: unknown, options: CellOptions): CellType { diff --git a/packages/abc/cell/demo/simple.md b/packages/abc/cell/demo/simple.md index 77f2f0a39..7b95c1d37 100644 --- a/packages/abc/cell/demo/simple.md +++ b/packages/abc/cell/demo/simple.md @@ -143,10 +143,8 @@ import { NzGridModule } from 'ng-zorro-antd/grid';
Text Unit =>
custom widget => - + + Refresh Image
`, @@ -165,6 +163,7 @@ export class DemoComponent implements OnInit { private readonly ds = inject(DomSanitizer); private readonly cdr = inject(ChangeDetectorRef); value: unknown = 'string'; + imageValue = 'https://randomuser.me/api/portraits/thumb/women/47.jpg'; checkbox = false; radio = true; disabled = false; @@ -221,5 +220,10 @@ export class DemoComponent implements OnInit { this.safeHtml = this.ds.bypassSecurityTrustHtml(`alert('a');`); this.cdr.detectChanges(); } + + refreshImage(): void { + this.imageValue = `https://randomuser.me/api/portraits/thumb/women/${Math.floor(Math.random() * 50) + 10}.jpg`; + this.cdr.detectChanges(); + } } ```