angular-csv-binding

AngularJS Module for two-way binding of csv data in textareas

Angular Core Dependency: *

Module License: MIT

Added by: Sam Deering

GitHub

Repository

justmaier/angular-csv-binding

Stats

Stars: 2

Watchers: 2

Forks: 0

Module Description

angular-csv-binding

Easily bind arrays of data to a textarea with CSV formating

Check out a demo!

##Installation

####Bower bower install angular-csv-binding

####Manually <script type="text/javascript" src="js/angular-csv-binding.js"></script>

##Usage

  1. Include the angular-csv-binding.js script provided by this component into your app
  2. add csvBinding as a module dependency to your app

####Javascript

angular.module('app', ['csvBinding'])
.controller('demo', ['$scope', function($scope){
    $scope.data = [{a:'test',b:'test2'}, {a:'test3',b:'test4'}];
    $scope.delimiter = ',';
    $scope.hasHeaders = true;
}]);

####html

<textarea class="form-control" rows="10" csv delimiter="delimiter" has-headers="hasHeaders" ng-model="data"></textarea> 
<pre ng-bind="data | json"></pre>

##Options

  • delimiter the separator of the values
  • hasHeaders whether or not the data you are providing has headers for each column

Module stats last updated: 2015-06-04 11:09:22

Disclaimer: Some data on this page may have been gathered from the authors GitHub respository. If you see any mistakes or outdated information please let us know. Thanks!