Skip to content

Commit 7687ff2

Browse files
fix(module:graph): fix @for track function (#8587)
1 parent b275063 commit 7687ff2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/graph/graph.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export function isDataSource(value: NzSafeAny): value is NzGraphData {
9090
<svg:g [attr.transform]="type === 'sub' ? subGraphTransform(renderNode) : null">
9191
<svg:g class="core" [attr.transform]="coreTransform(renderNode)">
9292
<svg:g class="nz-graph-edges">
93-
@for (edge of $asNzGraphEdges(renderNode.edges); track edgeTrackByFun) {
93+
@for (edge of $asNzGraphEdges(renderNode.edges); track edgeTrackByFun(edge)) {
9494
<g
9595
class="nz-graph-edge"
9696
nz-graph-edge
@@ -171,7 +171,7 @@ export class NzGraphComponent implements OnInit, OnChanges, AfterContentChecked,
171171
private _dataSubscription?: Subscription | null;
172172
private destroy$ = new Subject<void>();
173173

174-
edgeTrackByFun = (_: number, edge: NzGraphEdge): string => `${edge.v}-${edge.w}`;
174+
edgeTrackByFun = (edge: NzGraphEdge): string => `${edge.v}-${edge.w}`;
175175

176176
subGraphTransform = (node: NzGraphGroupNode): string => {
177177
const x = node.x - node.coreBox.width / 2.0;

0 commit comments

Comments
 (0)