# angularjs-datatables-service

> AngularJS service that serves as a wrapper for angular-datatables.js functions

Latest version **1.0.0** (published 2019-07-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install angularjs-datatables-service
pnpm add angularjs-datatables-service
yarn add angularjs-datatables-service
bun add angularjs-datatables-service
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-07-28 |
| First published | 2019-07-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 16.7 KB |
| Known vulnerabilities | 0 (+22 in 3 direct dependencies) |
| Install scripts | yes |
| GitHub stars | 0 |
| Author | Joe Moceri |
| Maintainers | jmoceri |
| Keywords | angularjs, datatables, angular-datatables.js |

## Links

- npm: https://www.npmjs.com/package/angularjs-datatables-service
- Repository: https://github.com/jmoceri34/angularjs-datatables-service
- Issues: http://github.com/jmoceri34/angularjs-datatables-service/issues
- npm.io page: https://npm.io/package/angularjs-datatables-service

## Dependencies (9)

- [jquery](https://npm.io/package/jquery.md) 3.3.x
- [angular](https://npm.io/package/angular.md) 1.7.x
- [bootstrap](https://npm.io/package/bootstrap.md) 3.3.x
- [angular-route](https://npm.io/package/angular-route.md) 1.7.x
- [datatables.net](https://npm.io/package/datatables.net.md) ^1.10.19
- [angular-animate](https://npm.io/package/angular-animate.md) 1.7.x
- [angular-resource](https://npm.io/package/angular-resource.md) 1.7.x
- [datatables.net-dt](https://npm.io/package/datatables.net-dt.md) ^1.10.19
- [angular-datatables](https://npm.io/package/angular-datatables.md) 0.6.4

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-07-28

## README

# angularjs-datatables-service

> AngularJS Service Wrapper for angular.datatables.js

* [Overview](#overview)
* [Install](#install)
* [Usage](#usage)

<a name="overview"></a>
## Overview
This is an AngularJS service wrapper for angular-datatables.js. Please refer to the [demo](https://joemoceri.github.io/angularjs-datatables-service/) for a complete example.

<a name="install"></a>
## Install
```sh
npm install angularjs-datatables-service --save
```

<a name="usage"></a>
## Usage
Include the following script
```html
<script type="text/javascript" src="angularjs-datatables-service.js"></script>
```

Include it in your app.module.js

```js
'use strict';

angular.module('exampleApp', [
    'angularjs-datatables-service'
]);
```

Then you can start using it by injecting it into your controller

```js
'use strict';

angular.module('example').controller('ExampleController', ExampleController);

ExampleController.$inject = ['dataTablesService', '$q'];

function ExampleController(dataTablesService, $q) {
    var vm = this;
    activate();

    function activate() {
        var table = {
            columns: [
                { data: 'Value1', title: 'Value 1', renderWith: 'default' },
                { data: 'Value2', title: 'Value 2', renderWith: 'default' },
                { data: 'Value3', title: 'Value 3', renderWith: 'default' },
                { data: 'Value4', title: 'Value 4', renderWith: 'default' }
            ],
            callback: getData
        };

        vm.table = dataTablesService.getDataTable(table.columns, table.options, table.callback, table.dom, table.buttons);
    }

    function getData() {
        var data = [
            {
                Value1: '1',
                Value2: '2',
                Value3: '3',
                Value4: '4'
            },
            {
                Value1: '1',
                Value2: '2',
                Value3: '3',
                Value4: '4'
            }
        ];
        var result = $q.when(data);

        return result;
    }
}
```
```html
<div class="container-fluid" ng-controller="ExampleController as vm">
  <div class="row">
      <div class="col-md-6">
          <table id="table"
                 datatable
                 dt-options="vm.table.options"
                 dt-columns="vm.table.columns"
                 dt-instance="vm.table.instance"
                 class="table table-striped table-bordered table-hover">
          </table>
      </div>
  </div>
</div>

```

---
_Source: https://npm.io/package/angularjs-datatables-service · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
