Angular wrapper dev

From handsontable/handsontable · View interactive version

Angular wrapper dev is an AI agent skill from the GitHub repository handsontable/handsontable. Use when developing or modifying the @handsontable/angular-wrapper package - Angular components with decorators, NgZone performance optimization, and ng-packagr build system

How to use this skill

Skill file

Angular Wrapper Development

Package: wrappers/angular-wrapper/; library source in projects/hot-table/src/lib/. Wrapper rules, build, and test commands: wrappers/angular-wrapper/AGENTS.md.

Architecture

HotTableComponent uses @Component with an @Input() per Handsontable option.

Services: HotSettingsResolver merges component inputs with the aggregate settings object (priority between them); HotGlobalConfig supplies global defaults for all instances. HotTableModule declares and exports the component.

Build: ng-packagr 22. Tests: Jest with jest-preset-angular and NODE_OPTIONS=--openssl-legacy-provider (already in the script). Wrappers consume handsontable/tmp/, not dist/; run npm run test --prefix wrappers/angular-wrapper after npm run build --prefix handsontable.

| File | Purpose |

|---|---|

| projects/hot-table/src/lib/hot-table.component.ts | Main grid component |

| projects/hot-table/src/lib/services/ | Settings resolver and global config |

| projects/hot-table/src/lib/hot-table.module.ts | Angular module |

Modern Angular patterns (all new and updated examples)

Standalone components

standalone: true with HotTableModule in imports.

import { Component } from '@angular/core';
import { HotTableModule } from '@handsontable/angular-wrapper';

@Component({
  selector: 'app-example1',
  standalone: true,
  imports: [HotTableModule],
  template: `<hot-table [settings]="hotSettings"></hot-table>`,
})
export class AppComponent { ... }

app.config.ts

Use an ApplicationConfig in app.config.ts in place of AppModule (@NgModule). Register Handsontable modules and the global license key there:

/* file: app.config.ts */
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
import { registerAllModules } from 'handsontable/registry';
import { HOT_GLOBAL_CONFIG, HotGlobalConfig } from '@handsontable/angular-wrapper';

registerAllModules();

export const appConfig: ApplicationConfig = {
  providers: [
    provideZoneChangeDetection({ eventCoalescing: true }),
    {
      provide: HOT_GLOBAL_CONFIG,
      useValue: {
        // license: 'your-license-key', // get a key at https://handsontable.com/pricing/
      } as HotGlobalConfig,
    },
  ],
};

Template control flow

Use Angular 17+ built-in control flow instead of structural directives.

| Old | Required |

|---|---|

| *ngIf="condition" | @if (condition) { ... } |

| *ngFor="let x of list" | @for (x of list; track x.id) { ... } |

Type safety

Naming

Example components are named AppComponent (not ExampleNComponent or feature-specific names).

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.