getting-started
できること
このスキルは、TanStack Tableを使ってAngularアプリに表を作る方法を示します。列とデータの定義から、行の表示までを扱います。表のレイアウトを自分で作りたいAngularの開発者向けです。
使う場面
- ✓記録の一覧を表示するAngularのコンポーネントを作っているとき。
- ✓Angularの表のデータがシグナルから来ており、画面で更新される必要があるとき。
- ✓AngularのテーブルにQueryやVirtualの機能を追加したいとき。
スキルのリンク
https://github.com/TanStack/table/blob/main/packages/angular-table/skills/getting-started/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“Angularのアプリに、注文の一覧を表示する表が必要です。どう設定すればよいでしょうか。”
毎週5つの新しいスキル。1分で読めます。
仕組み
コンポーネントの中でinjectTableを呼び出し、列とデータを渡す方法を説明します。そのうえで、FlexRenderのディレクティブを使って、テンプレートで行をループさせます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Load intent load @tanstack/table-core#core first for the headless model, stable inputs, and column inference.
Setup
import { Component, signal } from '@angular/core'
import { FlexRender, injectTable, tableFeatures } from '@tanstack/angular-table'
type Person = { name: string; age: number }
const features = tableFeatures({})
const columns = [
{ accessorKey: 'name', header: 'Name' },
{ accessorKey: 'age', header: 'Age' },
]
@Component({
selector: 'app-table',
imports: [FlexRender],
template: `<table>
<tbody>
@for (row of table.getRowModel().rows; track row.id) {
<tr>
@for (cell of row.getAllCells(); track cell.id) {
<td>
<ng-container *flexRenderCell="cell; let value">{{
value
}}</ng-container>
</td>
}
</tr>
}
</tbody>
</table>`,
})
export class TableComponent {
readonly data = signal<Person[]>([{ name: 'Ada', age: 36 }])
readonly table = injectTable(() => ({ features, columns, data: this.data() }))
}
Construction and rendering
Call injectTable in a component, directive, or service field initializer, or another valid Angular injection context. The adapter binds its cleanup to that context.
Signals read in the options initializer rerun it and call setOptions. Keep features, factories, and columns outside the initializer; return stable data references and derive transformed data with computed outside it.
Import FlexRender for *flexRender, *flexRenderCell, *flexRenderHeader, and *flexRenderFooter. Render values can be primitives, TemplateRef, component types, or flexRenderComponent(...). Use flexRenderComponent for Angular component types; ordinary render functions are already supported directly.
Read for the task
- When adding or configuring optional features, load
intent load @tanstack/table-core#table-featuresand read only references for the requested behavior. - For state ownership or reactive reads, read table-state.
- When tables share features, defaults, or reusable UI, read create-table-hook.
- When Query supplies data or server processing, read with-tanstack-query.
- When virtualizing rows or columns, read with-tanstack-virtual.
- When upgrading v8 code, read migrate-v8-to-v9.
API discovery
Inspect node_modules/@tanstack/angular-table/dist/types/ for the bundled public declarations. Inspect feature APIs under node_modules/@tanstack/table-core/dist/features/.
よくある質問
injectTableはどこで呼び出すべきですか?
コンポーネントかサービスのフィールド、または別の有効なAngularのインジェクションのコンテキストの中で、後片付けが自動的に行われるようにします。
データがシグナルの場合はどうなりますか?
シグナルが変わると、オプションが再実行されるので、表は新しい値に更新されます。
列はコンポーネントの外で定義すべきですか?
スキルは、更新のたびに作り直されないよう、機能と列をリアクティブなオプションの外に置くことを勧めています。
詳細
作者による元の説明
Create and render Table v9 with the angular adapter. Route reusable createTableHook components, Query and Virtual integration, and framework setup; use table-state for reactive ownership.
repo: TanStack/table
人気
- GitHubのスター
- 29k
- ランキング
- #9808
- ライセンス
- MIT
- 更新日
- 2026/10/21
コメント
- …
このリポジトリの他のスキル
getting-started
29kエージェントが、Alpine.jsでTanStack Tableを使ってデータテーブルを作り、表示する方法を教えます。セットアップ、リアクティブなデータ、行の描画を扱います。
table-state
29kエージェントが、Alpine.jsで表の状態(現在のページなど)を読み取り、制御する方法を教えます。その状態が変わると、画面が更新されます。
devtools
29kエージェントが、Angularの表をTanStack Devtoolsのパネルに登録する方法を教えます。開発者はアプリを作りながら、各表を調べられます。
migrate-v8-to-v9
29kエージェントが、Angularの表をTanStack Table v8からv9へ移行するのを助けます。設定、描画、状態、フックを移行チェックリストで確認します。
似ているスキル
angular-developer
280kエージェントがAngularのコードを作成し、プロジェクト構成についてアドバイスできるようにします。新しいプロジェクトの開始、コード部品の作成、パフォーマンスやアクセシビリティの改善に役立ちます。
frontend-a11y
280kエージェントが Web インターフェースを誰にとっても使いやすくするよう支援します。スクリーンリーダーやキーボード操作に対応し、サイトやアプリが適切に動作するようにします。
frontend-patterns
280kエージェントがフロントエンド開発の最新パターンを適用できるようにします。React と Next.js において、パフォーマンスの最適化、状態管理、ベストプラクティスの遵守を行います。