ng-csv

WebJar for ng-csv

License

License

MIT
Categories

Categories

CSV Data Data Formats
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

ng-csv
Last Version

Last Version

0.3.6
Release Date

Release Date

Type

Type

jar
Description

Description

ng-csv
WebJar for ng-csv
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/asafdav/ng-csv

Download ng-csv

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/ng-csv/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>ng-csv</artifactId>
    <version>0.3.6</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/ng-csv/
implementation 'org.webjars.bower:ng-csv:0.3.6'
// https://jarcasting.com/artifacts/org.webjars.bower/ng-csv/
implementation ("org.webjars.bower:ng-csv:0.3.6")
'org.webjars.bower:ng-csv:jar:0.3.6'
<dependency org="org.webjars.bower" name="ng-csv" rev="0.3.6">
  <artifact name="ng-csv" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='ng-csv', version='0.3.6')
)
libraryDependencies += "org.webjars.bower" % "ng-csv" % "0.3.6"
[org.webjars.bower/ng-csv "0.3.6"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.bower : angular jar [1,2)
org.webjars.bower : angular-sanitize jar [1,2)

Project Modules

There are no modules declared in this project.

ngCsv - Export to CSV using AngularJS

An AngularJS simple directive that turns arrays and objects into downloadable CSV files,

Build Status

Dependencies

  • angular.js (of course!), any version starting with 1
  • angular-sanitize.js, any version starting with 1

How to get it ?

Manual Download

Download the from here

Bower

bower install ng-csv

Npm

npm install ng-csv

CDN

ng-csv is available at cdnjs

Usage

  1. Add ng-csv.min.js to your main file (index.html). please also make sure you're adding angular-sanitize.min.js.

  2. Set ngCsv as a dependency in your module

var myapp = angular.module('myapp', ['ngSanitize', 'ngCsv'])
  1. Add ng-csv directive to the wanted element, example:
<button type="button" ng-csv="getArray" filename="test.csv">Export</button>

ngCsv attributes

  • ng-csv: The data array - Could be an expression, a value or a promise.

  • filename: The filename that will be stored on the user's computer

  • csv-header: If provided, would use this attribute to create a header row

    <button type="button" ng-csv="getArray" csv-header="['Field A', 'Field B', 'Field C']" filename="test.csv">Export</button>
  • csv-column-order: Defines the column order to be set when creating the body of the CSV (may be according to the csv-headers) - use it when you have an array of objects.

  • field-separator: Defines the field separator character (default is ,)

  • decimal-separator: Defines the decimal separator character (default is .). If set to "locale", it uses the language sensitive representation of the number.

  • text-delimiter: If provided, will use this characters to "escape" fields, otherwise will use double quotes as deafult

  • quote-strings: If provided, will force escaping of every string field.

  • lazy-load: If defined and set to true, ngCsv will generate the data string only on demand. See the lazy_load example for more details.

  • add-bom: Add the Byte Order Mark, use this option if you are getting an unexpected char when opening the file on any windows App.

  • charset: Defines the charset of the downloadable Csv file. Default is "utf-8".

  • csv-label: Defines whether or not using keys as csv column value (default is false).

Examples

You can check out this live example here: https://asafdav.github.io/ng-csv/example/

For lazy load example using promises see this example: https://asafdav.github.io/ng-csv/example/lazy_load.html

Supported Browsers

Browser Filenames
Firefox 20+ Yes
Chrome 14+ Yes
Safari No
IE 10+ Yes

Bitdeli Badge

Versions

Version
0.3.6
0.3.4
0.3.3
0.3.2
0.3.1
0.2.6