diff --git a/README.md b/README.md
index 23850fd..36122a4 100644
--- a/README.md
+++ b/README.md
@@ -40,7 +40,8 @@ Include the **ng-csv-import** element with its options:
+ result="csv.result"
+ accept="csv.accept">
```
- **csv.content**
@@ -74,3 +75,7 @@ A variable to toggle encoding visibility
- **csv.result**
A variable which will contain the result of the CSV to JSON marshalling.
+
+- **csv.accept**
+
+An optional variable to limit what file types are accepted. Ex. ".csv" to only accept csv file types.
\ No newline at end of file
diff --git a/dist/angular-csv-import.js b/dist/angular-csv-import.js
index 5f9557f..31603d0 100644
--- a/dist/angular-csv-import.js
+++ b/dist/angular-csv-import.js
@@ -1,6 +1,4 @@
-/*! angular-csv-import - v0.0.20 - 2015-09-22
-* Copyright (c) 2015 ; Licensed */
-/*! angular-csv-import - v0.0.18 - 2015-09-04
+/*! angular-csv-import - v0.0.26 - 2015-11-11
* Copyright (c) 2015 ; Licensed */
'use strict';
@@ -19,12 +17,18 @@ csvImport.directive('ngCsvImport', function() {
separatorVisible: '=?',
result: '=?',
encoding: '=?',
- encodingVisible: '=?'
+ encodingVisible: '=?',
+ accept: '=?'
},
- template: '
'+
+ template: '
',
+ '
'+
+ '
Seperator
'+
+ '
'+
+ ''+
+ '
'+
+ '
',
link: function(scope, element) {
scope.separatorVisible = scope.separatorVisible || false;
scope.headerVisible = scope.headerVisible || false;
@@ -88,7 +92,7 @@ csvImport.directive('ngCsvImport', function() {
var obj = {};
var currentline=lines[i].split(new RegExp(content.separator+'(?![^"]*"(?:(?:[^"]*"){2})*[^"]*$)'));
if ( currentline.length === columnCount ) {
- if (content.header) {
+ if (content.header) {
for (var j=0; j',link:function(a,b){a.separatorVisible=a.separatorVisible||!1,a.headerVisible=a.headerVisible||!1,angular.element(b[0].querySelector(".separator-input")).on("keyup",function(b){if(null!=a.content){var d={csv:a.content,header:a.header,separator:b.target.value,encoding:a.encoding};a.result=c(d),a.$apply()}}),b.on("change",function(b){var d=new FileReader;if(a.filename=b.target.files[0].name,d.onload=function(b){a.$apply(function(){var d={csv:b.target.result.replace(/\r\n|\r/g,"\n"),header:a.header,separator:a.separator};a.content=d.csv,a.result=c(d),a.result.filename=a.filename})},"file"!==b.target.type||null==b.target.files&&null==b.srcElement.files){if(null!=a.content){var e={csv:a.content,header:!a.header,separator:a.separator};a.result=c(e)}}else d.readAsText((b.srcElement||b.target).files[0],a.encoding)});var c=function(a){var b=a.csv.split("\n"),c=[],d=0,e=b[0].split(a.separator).length,f=[];a.header&&(f=b[0].split(a.separator),d=1);for(var g=d;g',link:function(a,b){a.separatorVisible=a.separatorVisible||!1,a.headerVisible=a.headerVisible||!1,angular.element(b[0].querySelector(".separator-input")).on("keyup",function(b){if(null!=a.content){var d={csv:a.content,header:a.header,separator:b.target.value,encoding:a.encoding};a.result=c(d),a.$apply()}}),b.on("change",function(b){var d=new FileReader;if(a.filename=b.target.files[0].name,d.onload=function(b){a.$apply(function(){var d={csv:b.target.result.replace(/\r\n|\r/g,"\n"),header:a.header,separator:a.separator};a.content=d.csv,a.result=c(d),a.result.filename=a.filename})},"file"!==b.target.type||null==b.target.files&&null==b.srcElement.files){if(null!=a.content){var e={csv:a.content,header:!a.header,separator:a.separator};a.result=c(e)}}else d.readAsText((b.srcElement||b.target).files[0],a.encoding)});var c=function(a){var b=a.csv.split("\n"),c=[],d=0,e=b[0].split(a.separator).length,f=[];a.header&&(f=b[0].split(a.separator),d=1);for(var g=d;g'+
+ template: '',
+ ''+
+ '
Seperator
'+
+ '
'+
+ ' '+
+ ''+
+ '',
link: function(scope, element) {
scope.separatorVisible = scope.separatorVisible || false;
scope.headerVisible = scope.headerVisible || false;
@@ -86,7 +90,7 @@ csvImport.directive('ngCsvImport', function() {
var obj = {};
var currentline=lines[i].split(new RegExp(content.separator+'(?![^"]*"(?:(?:[^"]*"){2})*[^"]*$)'));
if ( currentline.length === columnCount ) {
- if (content.header) {
+ if (content.header) {
for (var j=0; j