1- /*! angular-csv-import - v0.0.36 - 2016-11-01
2- * Copyright (c) 2016 ; Licensed */
1+ /*! angular-csv-import - v0.0.37 - 2017-05-19
2+ * Copyright (c) 2017 ; Licensed */
33'use strict' ;
44
55var csvImport = angular . module ( 'ngCsvImport' , [ ] ) ;
@@ -35,7 +35,7 @@ csvImport.directive('ngCsvImport', function() {
3535 '<div ng-show="headerVisible"><div class="label">Header</div>' +
3636 ( material ? '<input type="checkbox" ng-model="header"></div>' :
3737 '<md-switch class="ng-csv-import-header-switch" ng-model="header"></md-switch>' ) +
38- '<div ng-show="encoding "><div class="label">Encoding</div><span>{{encoding}}</span></div>' +
38+ '<div ng-show="encodingVisible "><div class="label">Encoding</div><span>{{encoding}}</span></div>' +
3939 '<div ng-show="separatorVisible">' +
4040 '<div class="label">Seperator</div>' +
4141 '<span><input class="separator-input ' + ( material ? '_md md-input' : '' ) + ' " type="text" ng-change="changeSeparator" ng-model="separator"><span>' +
@@ -83,7 +83,9 @@ csvImport.directive('ngCsvImport', function() {
8383 scope . result = csvToJSON ( content ) ;
8484 scope . $apply ( ) ;
8585 if ( typeof scope . callback === 'function' ) {
86- scope . callback ( e ) ;
86+ if ( scope . callback != null ) {
87+ scope . callback ( e ) ;
88+ }
8789 }
8890 }
8991 } ) ;
@@ -114,7 +116,9 @@ csvImport.directive('ngCsvImport', function() {
114116 scope . result . filename = scope . filename ;
115117 scope . $$postDigest ( function ( ) {
116118 if ( typeof scope . callback === 'function' ) {
117- scope . callback ( onChangeEvent ) ;
119+ if ( scope . callback != null ) {
120+ scope . callback ( onChangeEvent ) ;
121+ }
118122 }
119123 } ) ;
120124 } ) ;
@@ -132,7 +136,9 @@ csvImport.directive('ngCsvImport', function() {
132136 scope . result = csvToJSON ( content ) ;
133137 scope . $$postDigest ( function ( ) {
134138 if ( typeof scope . callback === 'function' ) {
135- scope . callback ( onChangeEvent ) ;
139+ if ( scope . callback != null ) {
140+ scope . callback ( onChangeEvent ) ;
141+ }
136142 }
137143 } ) ;
138144 }
0 commit comments