1- /*! angular-csv-import - v0.0.20 - 2015-09-22
2- * Copyright (c) 2015 ; Licensed */
3- /*! angular-csv-import - v0.0.18 - 2015-09-04
1+ /*! angular-csv-import - v0.0.26 - 2015-11-11
42* Copyright (c) 2015 ; Licensed */
53'use strict' ;
64
@@ -19,12 +17,18 @@ csvImport.directive('ngCsvImport', function() {
1917 separatorVisible : '=?' ,
2018 result : '=?' ,
2119 encoding : '=?' ,
22- encodingVisible : '=?'
20+ encodingVisible : '=?' ,
21+ accept : '=?'
2322 } ,
24- template : '<div><div ng-show="headerVisible"><div class="label">Header</div><input type="checkbox" ng-model="header"></div>' +
23+ template : '<div>' +
24+ '<div ng-show="headerVisible"><div class="label">Header</div><input type="checkbox" ng-model="header"></div>' +
2525 '<div ng-show="encoding && encodingVisible"><div class="label">Encoding</div><span>{{encoding}}</span></div>' +
26- '<div ng-show="separator && separatorVisible"><div class="label">Seperator</div><span><input class="separator-input" type="text" ng-change="changeSeparator" ng-model="separator"><span></div>' +
27- '<div><input class="btn cta gray" type="file"/></div></div>' ,
26+ '<div ng-show="separator && separatorVisible">' +
27+ '<div class="label">Seperator</div>' +
28+ '<span><input class="separator-input" type="text" ng-change="changeSeparator" ng-model="separator"><span>' +
29+ '</div>' +
30+ '<div><input class="btn cta gray" type="file" multiple accept="{{accept}}"/></div>' +
31+ '</div>' ,
2832 link : function ( scope , element ) {
2933 scope . separatorVisible = scope . separatorVisible || false ;
3034 scope . headerVisible = scope . headerVisible || false ;
@@ -88,7 +92,7 @@ csvImport.directive('ngCsvImport', function() {
8892 var obj = { } ;
8993 var currentline = lines [ i ] . split ( new RegExp ( content . separator + '(?![^"]*"(?:(?:[^"]*"){2})*[^"]*$)' ) ) ;
9094 if ( currentline . length === columnCount ) {
91- if ( content . header ) {
95+ if ( content . header ) {
9296 for ( var j = 0 ; j < headers . length ; j ++ ) {
9397 obj [ headers [ j ] ] = currentline [ j ] ;
9498 }
@@ -104,4 +108,4 @@ csvImport.directive('ngCsvImport', function() {
104108 } ;
105109 }
106110 } ;
107- } ) ;
111+ } ) ;
0 commit comments