Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON/JS array format #200

Open
ORESoftware opened this issue Mar 9, 2017 · 3 comments
Open

JSON/JS array format #200

ORESoftware opened this issue Mar 9, 2017 · 3 comments

Comments

@ORESoftware
Copy link

Looking forward to using this module!

What's missing in the docs (IMO) is the format of the array - there are several different potential array formats.

I can try to figure this out, but it would best if this were explicitly stated, all we need is a couple elements in the array and we will get the idea so it should fit easily in the README.md file, thx

@ORESoftware
Copy link
Author

in other words, I am looking for:

 $scope.getArray = function(){

      return [];  // what format is the array supposed to have? :)

    };

@ORESoftware
Copy link
Author

ORESoftware commented Mar 9, 2017

so I tried this:

   $scope.getArray = function () {

      return [
        {
          a: 'b',
          c: 'd',
          x: 'e'
        },
        {
          a: 'v',
          c: 'r',
          x: 't'
        }];

    };

and I basically get:

b,d,e
v,r,t

so that seems to work, but I wish the headers would be inferred

@davidamitchell
Copy link

if you use the csv-label directive then the keys will be the header row of the csv file.

csv-label: Defines whether or not using keys as csv column value (default is false).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants