Skip to content

Commit

Permalink
Merge branch 'langman66-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
asafdav committed May 6, 2014
2 parents f567e82 + 7214a68 commit 22b8973
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng-csv",
"version": "0.1.1",
"version": "0.1.2",
"main": "build/ng-csv.min.js",
"dependencies": {
"angular": "~1",
Expand Down
12 changes: 7 additions & 5 deletions build/ng-csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ angular.module('ngCsv.directives', []).
{
var csvContent = "data:text/csv;charset=utf-8,";

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

var arrData;

if (angular.isArray(data))
arrData = data;
else
arrData = data();
if (angular.isArray(responseData)) {
arrData = responseData;
}
else {
arrData = responseData();
}

angular.forEach(arrData, function(row, index)
{
Expand Down
4 changes: 2 additions & 2 deletions build/ng-csv.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions src/ng-csv/directives/ng-csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ angular.module('ngCsv.directives', []).
{
var csvContent = "data:text/csv;charset=utf-8,";

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

var arrData;

if (angular.isArray(data))
arrData = data;
else
arrData = data();
if (angular.isArray(responseData)) {
arrData = responseData;
}
else {
arrData = responseData();
}

angular.forEach(arrData, function(row, index)
{
Expand Down

0 comments on commit 22b8973

Please sign in to comment.