Skip to content

Commit 22b8973

Browse files
committed
Merge branch 'langman66-master'
2 parents f567e82 + 7214a68 commit 22b8973

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ng-csv",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"main": "build/ng-csv.min.js",
55
"dependencies": {
66
"angular": "~1",

build/ng-csv.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ angular.module('ngCsv.directives', []).
8282
{
8383
var csvContent = "data:text/csv;charset=utf-8,";
8484

85-
$q.when(data).then(function ()
85+
$q.when(data).then(function (responseData)
8686
{
8787
// Check if there's a provided header array
8888
if (angular.isDefined($attrs.csvHeader))
@@ -109,10 +109,12 @@ angular.module('ngCsv.directives', []).
109109

110110
var arrData;
111111

112-
if (angular.isArray(data))
113-
arrData = data;
114-
else
115-
arrData = data();
112+
if (angular.isArray(responseData)) {
113+
arrData = responseData;
114+
}
115+
else {
116+
arrData = responseData();
117+
}
116118

117119
angular.forEach(arrData, function(row, index)
118120
{

build/ng-csv.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ng-csv/directives/ng-csv.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ angular.module('ngCsv.directives', []).
5555
{
5656
var csvContent = "data:text/csv;charset=utf-8,";
5757

58-
$q.when(data).then(function ()
58+
$q.when(data).then(function (responseData)
5959
{
6060
// Check if there's a provided header array
6161
if (angular.isDefined($attrs.csvHeader))
@@ -82,10 +82,12 @@ angular.module('ngCsv.directives', []).
8282

8383
var arrData;
8484

85-
if (angular.isArray(data))
86-
arrData = data;
87-
else
88-
arrData = data();
85+
if (angular.isArray(responseData)) {
86+
arrData = responseData;
87+
}
88+
else {
89+
arrData = responseData();
90+
}
8991

9092
angular.forEach(arrData, function(row, index)
9193
{

0 commit comments

Comments
 (0)