Want to use subarray in ng-repeat

Issue

My two dimensional is like this

  {
    "MKey1": {
      "v1": "2015-10-29 14:03:41",
      "v2": "2016-01-04 15:36:13",
      "v3": "2015-11-02 19:53:11",
      "v4": "2015-12-09 19:15:04",
      "v5": "2015-08-18 19:12:37",
      "v6": "2015-09-20 17 :00:58"
    },
    "Mkey2": {
      "v1": "2015-10-29 14:03:41",
      ".v2": "2016-01-04 15:36:13",
      "v3": "2015-11-02 19:53:11",
      "v4": "2015-12-09 19:15:04",
      "v5": "2015-08-18 19:12:37",
      "v6": "2015-09-20 17:00:58"
    }
  }

here almost everything is dynamic, even Key & values. Want to take first set of array and need to print inner array key values in table

Solution

Try like this

<div ng-repeat="(key, value) in obj" ng-if="$first">
  <div ng-repeat="(subkey, subvalue) in value">
    {{subvalue}}
  </div>
</div>

DEMO

Answered By – Anik Islam Abhi

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published