Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Mar 18, 2024
1 parent d427157 commit 64263f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/abc/cell/cell.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
12 changes: 8 additions & 4 deletions packages/abc/cell/demo/simple.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,8 @@ import { NzGridModule } from 'ng-zorro-antd/grid';
<div nz-col nzSpan="8"> Text Unit => <cell [value]="{ text: '100', unit: '元' }" /> </div>
<div nz-col nzSpan="8">
custom widget =>
<cell
value="https://randomuser.me/api/portraits/thumb/women/47.jpg"
[options]="{ widget: { key: 'test', data: 'new url' } }"
/>
<cell [value]="imageValue" [options]="{ widget: { key: 'test', data: 'new url' } }" />
<a (click)="refreshImage()">Refresh Image</a>
</div>
</div>
`,
Expand All @@ -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;
Expand Down Expand Up @@ -221,5 +220,10 @@ export class DemoComponent implements OnInit {
this.safeHtml = this.ds.bypassSecurityTrustHtml(`alert('a');<script>alert('a')</script>`);
this.cdr.detectChanges();
}

refreshImage(): void {
this.imageValue = `https://randomuser.me/api/portraits/thumb/women/${Math.floor(Math.random() * 50) + 10}.jpg`;
this.cdr.detectChanges();
}
}
```

0 comments on commit 64263f8

Please sign in to comment.