Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

I have a json file that has arrays within an array and for the life of me I can't think of how to access a particular value from the inner array when using ng-repeat.

So here is a sample of the json file I'm using:

{
  "data" : [ [ 1, "F32A106E-76E3-49E5-AF73-22690DFA892B", 1, 1470051383, "939314", 1470051383, "939314", null, "122151194", "12 STONE CONTRACTING GROUP, INC.", "FOREIGN BUSINESS CORPORATION", "2016-06-01T00:00:00", "MAILING ADDRESS", null, null, null, null, null, null, null, "PO BOX 8958", null, "ATLANTA", "GA", "31106" ]
, [ 2, "96752850-352F-4D9F-B1C0-80BE194C8B6B", 2, 1470051383, "939314", 1470051383, "939314", null, "122151194", "12 STONE CONTRACTING GROUP, INC.", "FOREIGN BUSINESS CORPORATION", "2016-06-01T00:00:00", "PRINCIPAL PLACE OF BUSINESS", null, null, null, null, null, null, null, "5855 HIGHWAY 5", null, "DOUGLASVILLE", "GA", "30135" ]
, [ 3, "CE0A65F3-01D2-4F07-A2EE-8EC22091D9EA", 3, 1470051383, "939314", 1470051383, "939314", null, "122151194", "12 STONE CONTRACTING GROUP, INC.", "FOREIGN BUSINESS CORPORATION", "2016-06-01T00:00:00", "REGISTERED AGENT", null, null, null, null, null, "329227", "C T CORPORATION SYSTEM", "388 STATE ST STE 420", null, "SALEM", "OR", "97301" ]
, [ 4, "050AD941-5A5B-4068-917D-0025763A3E9F", 4, 1470051383, "939314", 1470051383, "939314", null, "122141294", "ABBA'S GARDEN", "DOMESTIC NONPROFIT CORPORATION", "2016-06-01T00:00:00", "MAILING ADDRESS", "KYLE", null, "ROY", null, null, null, null, "2426 SE 70TH AVE", null, "PORTLAND", "OR", "97206" ]
, [ 5, "6784F41D-C101-4630-BC1A-86EEDA054D1C", 5, 1470051383, "939314", 1470051383, "939314", null, "122141294", "ABBA'S GARDEN", "DOMESTIC NONPROFIT CORPORATION", "2016-06-01T00:00:00", "REGISTERED AGENT", "KYLE", null, "ROY", null, null, null, null, "2426 SE 70TH AVE", null, "PORTLAND", "OR", "97206" ]
, [ 6, "216D4AF9-7917-473A-9E9F-45B4DF6D0695", 6, 1470051383, "939314", 1470051383, "939314", null, "122140098", "AIR 1 PLUMBING INC", "FOREIGN BUSINESS CORPORATION", "2016-06-01T00:00:00", "MAILING ADDRESS", null, null, null, null, null, null, null, "9012 NE 89TH CIRCLE", null, "VANCOUVER", "WA", "98662" ]
, [ 7, "5AB2BC67-C612-459A-B3CE-0C454413522F", 7, 1470051383, "939314", 1470051383, "939314", null, "122140098", "AIR 1 PLUMBING INC", "FOREIGN BUSINESS CORPORATION", "2016-06-01T00:00:00", "PRINCIPAL PLACE OF BUSINESS", null, null, null, null, null, null, null, "9012 NE 89TH CIRCLE", null, "VANCOUVER", "WA", "98662" ]
, [ 11497, "35C994F6-51B3-4731-ABA0-0B081E291D84", 11497, 1470051406, "939314", 1470051406, "939314", null, "122972292", "PNW ROOFING LLC", "DOMESTIC LIMITED LIABILITY COMPANY", "2016-06-30T00:00:00", "REGISTERED AGENT", "ANATOLIY", null, "KHARKOV", null, null, null, null, "1334 MCGEE CT NE APT 204", null, "KEIZER", "OR", "97303" ]
 ]
}

My thought was to do something like this:

<div ng-repeat="x in results">{{x.data[6]}}</div>

But the above just gives me all the values in line 7 and not what I'm really looking for, which is a list of all the 7th place values in each of the inner arrays.

share|improve this question

Use a nested ng-repeat:

<div ng-repeat="x in results">
    <div ng-repeat="y in x">y[6]</div>
</div>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.