Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Angular Performance List Rendering Optimization

ASecurity

Optimizes Angular list rendering by using stable identity tracking with trackBy for legacy templates or @for track for modern Angular.

4 stars
0 votes
0 copies
0 views
Added 10/2/2026
developmenttypescriptgoangularapifrontendbackendperformance

Works with

api

Security Analysis

A100/100

Scanned 10/2/2026

$npx -y skills add janpereira-dev/ngAutoPilot --skill angular--performance--list-rendering-optimization --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Angular Performance List Rendering Optimization?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Angular  Performance  List Rendering Optimization
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/janpereira-dev-angular-performance-list-rendering-optimization/badge)](https://www.skillsdirectory.com/skills/janpereira-dev-angular-performance-list-rendering-optimization)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
id: angular.performance.list-rendering-optimization
name: Angular List Rendering Optimization
description: >
  Optimizes Angular list rendering by using stable identity tracking with trackBy for legacy templates or @for track for modern Angular.
stack:
  - Angular
  - TypeScript
category: performance
status: stable
version: 0.10.0
owner: NgAutoPilot
triggers:
  - list rendering
  - trackBy
  - "@for track"
  - large list
  - DOM recreation
  - virtual scroll
compatibility:
  angular:
    min: "2"
    controlFlowFrom: "17"
    ngForDeprecatedFrom: "20"
---

# Angular List Rendering Optimization

## Purpose

Use this skill to avoid unnecessary DOM recreation in Angular lists by choosing the correct identity tracking pattern for the detected Angular version.

## Compatibility

Use the compatible variant:

- Angular 2-16: use `*ngFor` with `trackBy`.
- Angular 17-19: prefer `@for (...; track item.id)` for new code, while keeping `*ngFor + trackBy` as a valid fallback.
- Angular 20+: avoid introducing new `NgFor` usage; prefer `@for` for new code.

## When to Use

Use this skill when:

- A table, grid, select, search result, feed, or list renders many items.
- The list is refreshed from an API or state store.
- Rows are inserted, deleted, filtered, sorted, or paginated.
- Focus, expanded rows, animations, or child component state are lost after refresh.
- The user reports visible re-rendering or scroll lag.

## Do

For Angular 2-16 or legacy templates, use `trackBy`:

```html
<div *ngFor="let item of items; trackBy: trackById">{{ item.name }}</div>
```

```ts
trackById(_index: number, item: Item): string | number {
  return item.id;
}
```

For Angular 17+ new templates, use `@for` with `track`:

```html
@for (item of items; track item.id) {
<div>{{ item.name }}</div>
}
```

For very large lists, evaluate virtual scrolling after identity tracking is correct.

## Do Not

Avoid missing identity tracking:

```html
<div *ngFor="let item of items">{{ item.name }}</div>
```

Avoid unstable keys:

```html
@for (item of items; track createRandomId(item)) {
<div>{{ item.name }}</div>
}
```

Avoid index tracking for lists that reorder, filter, insert, or delete in the middle.

## Review Checklist

- [ ] The Angular version is checked before choosing `*ngFor` or `@for`.
- [ ] The list has stable identity tracking.
- [ ] The key is unique within the rendered collection.
- [ ] Index tracking is limited to static lists.
- [ ] The template does not transform the list on every render.
- [ ] Virtual scroll is considered only for genuinely large rendered lists.
- [ ] Backend pagination is considered when frontend rendering is not the only bottleneck.

## Expected Output

1. Detect whether the project uses legacy or modern Angular templates.
2. Add `trackBy` or `@for track` using a stable identifier.
3. Avoid changing list behavior beyond identity tracking.
4. Mention virtual scroll only when list size justifies it.
5. Explain fallback or migration path for older Angular versions.

Attribution

janpereira-devjanpereira-dev
View sourceSee grades on GitHubMore from janpereira-dev →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Clean Code

Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments

304955 votes

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

286712 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2222 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Writing Plans

Use when you have a spec or requirements for a multi-step task, before touching code

2927051 votes
View all in development →