Basic example
优质
小牛编辑
123浏览
2023-12-01
An implementation of the @handsontable/angular
wrapper.
// app.component.ts import { Component } from '@angular/core'; import * as Handsontable from 'handsontable'; @Component({ selector: 'app-root', template: ` `, }) class AppComponent { dataset: any[] = [ {id: 1, name: 'Ted Right', address: 'Wall Street'}, {id: 2, name: 'Frank Honest', address: 'Pennsylvania Avenue'}, {id: 3, name: 'Joan Well', address: 'Broadway'}, {id: 4, name: 'Gail Polite', address: 'Bourbon Street'}, {id: 5, name: 'Michael Fair', address: 'Lombard Street'}, {id: 6, name: 'Mia Fair', address: 'Rodeo Drive'}, {id: 7, name: 'Cora Fair', address: 'Sunset Boulevard'}, {id: 8, name: 'Jack Right', address: 'Michigan Avenue'}, ]; } // app.module.ts import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { HotTableModule } from '@handsontable/angular'; @NgModule({ imports: [ BrowserModule, HotTableModule ], declarations: [ AppComponent ], bootstrap: [ AppComponent ] }) class AppModule { } // bootstrap import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; platformBrowserDynamic().bootstrapModule(AppModule).catch(err => { console.error(err) });The same example you can find here.