Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/buoyad/ngdatasheet

Excel-esque datasheet for Angular 2
https://github.com/buoyad/ngdatasheet

angular2 datasheet npm npm-module webcomponent

Last synced: 9 days ago
JSON representation

Excel-esque datasheet for Angular 2

Awesome Lists containing this project

README

        

# NgDatasheet

Datasheet component for Angular 2 that allows user interaction and prettified display alike.

## Notice

This component is still under development. Breaking changes are subject to release with no notice.

## Installation

`npm install --save ngdatasheet`

## Usage

Import NgDatasheetModule into your NgModule:

```typescript
...
import { NgModule } from '@angular/core';
import { NgDatasheetModule } from 'ngdatasheet/ngdatasheet';
...

...
@NgModule({
imports: [ NgDatasheetModule ]
...
```

In your component define a 2-D data array:

```typescript
public data: any[][] = [
['Item', 'Unit price', 'Quantity', 'Price'],
['Joy Division shirt', 25, 4, 100],
['Cutoff jeans', 30, 24, 720],
['Peeps', 1.25, 100, 125],
['Subtotal', , , 945],
['Tax', , '3.0%', .03*945],
['Total', , , 945 + .03*945]
]
```

And bind to it in your template:

```html

```
Output:

## Planned Features

* Inline expression evaluation
* `data` property:
* Support for relative expressioning via property
* Support for defining cells as read-only
* Support for inline templating with the following API:
* Defining templates within the `` using a directive
* Injecting `` with selector as supplied in the appropriate spot in the `data` array