Skillpedia
المواقع والواجهات (frontend)29k · #9808

getting-started

ما الذي تفعله

تشرح هذه المهارة كيف تبني جدولًا في تطبيق Angular باستخدام TanStack Table، من تعريف الأعمدة والبيانات حتى عرض الصفوف. وهي مخصصة لمطوري Angular الذين يريدون بناء تخطيط الجدول بأنفسهم.

متى تستخدمها

  • ✓عندما تُنشئ مكون Angular يعرض قائمة سجلات في جدول.
  • ✓عندما تأتي بيانات جدول Angular من signals ويجب أن تتحدث على الشاشة.
  • ✓عندما تريد إضافة ميزات Query أو Virtual إلى جدول Angular.

رابط المهارة

https://github.com/TanStack/table/blob/main/packages/angular-table/skills/getting-started/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/TanStack/table/blob/main/packages/angular-table/skills/getting-started/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“أحتاج إلى جدول في تطبيق Angular يعرض قائمة طلبات. كيف أعدّه؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تشرح المهارة كيف تستدعي 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-features and 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، فتُدار عملية التنظيف تلقائيًا.

ماذا يحدث إذا كانت بياناتي signal؟

تُعاد تشغيل الخيارات عند تغيّر الـ signal، فيتحدث الجدول بالقيم الجديدة.

هل يجب تعريف الأعمدة خارج المكون؟

تنصح المهارة بإبقاء الميزات والأعمدة خارج الخيارات التفاعلية حتى لا تُعاد بناؤها عند كل تحديث.

التفاصيل

الوصف الأصلي من المؤلف

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
آخر تحديث
21‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة