2017-02-13 2 views
0

ng-repeat nicht auf dritte Schleife arbeiten (dritte Ebene)ng-repeat nicht auf dritte Schleife arbeitet

<div ng-repeat="child in jdata.children"> 
     <div ng-repeat="childsub in child.children"> 
      <div ng-repeat="text in childsub.text"> 
       {{ text.value}} 
      </div> 
     </div> 
    </div> 

auf dritte Schleife funktioniert nicht

JSON Daten (plunker link) ist als

{ 
    "children": [ 
    { 
     "type": "layer", 
     "visible": true, 
     "opacity": 1, 
     "blendingMode": "normal", 
     "name": "border", 
     "left": 0, 
     "right": 320, 
     "top": 0, 
     "bottom": 50, 
     "height": 50, 
     "width": 320, 
     "mask": {}, 
     "image": {} 
    }, 
    { 
     "type": "group", 
     "visible": false, 
     "opacity": 1, 
     "blendingMode": "normal", 
     "name": "Frame 1", 
     "left": -26, 
     "right": 338, 
     "top": 0, 
     "bottom": 182, 
     "height": 182, 
     "width": 364, 
     "childrens": [ 
     { 
      "type": "layer", 
      "visible": true, 
      "opacity": 1, 
      "blendingMode": "normal", 
      "name": "Savings that will make you smile like Barney", 
      "left": 117, 
      "right": 290, 
      "top": 7, 
      "bottom": 44, 
      "height": 37, 
      "width": 173, 
      "mask": {}, 
      "text": { 
      "value": "Savings that will make\ryou smile like Barney", 
      "font": { 
       "name": "VAGRoundedStd-Bold", 
       "sizes": [ 
       13, 
       13, 
       13, 
       13, 
       13 
       ], 
       "colors": [ 
       [ 
        91, 
        64, 
        142, 
        255 
       ], 
       [ 
        91, 
        64, 
        142, 
        255 
       ], 
       [ 
        91, 
        64, 
        142, 
        255 
       ], 
       [ 
        236, 
        0, 
        140, 
        255 
       ], 
       [ 
        91, 
        64, 
        142, 
        255 
       ] 
       ], 
       "alignment": [ 
       "center", 
       "center" 
       ] 
      }, 
      "left": 0, 
      "top": 0, 
      "right": 0, 
      "bottom": 0, 
      "transform": { 
       "xx": 1.3601764888729304, 
       "xy": 0, 
       "yx": 0, 
       "yy": 1.3627518109295933, 
       "tx": 203.50000000000003, 
       "ty": 20.704124478480498 
      } 
      }, 
      "image": {} 
     } 
     ] 
    } 
    ], 
    "document": { 
    "width": 320, 
    "height": 50, 
    "resources": { 
     "layerComps": [], 
     "guides": [], 
     "slices": [] 
    } 
    } 
} 
folgt
+0

Warum nicht einfach eine ng-Option? –

+0

Sie haben einen 'Kinder' Schlüssel –

Antwort

7

Sie haben auf der zweiten Ebene "Kinder" falsch geschrieben.

<div ng-repeat="child in jdata.children"> 
     <div ng-repeat="childsub in child.childrens"> 
      <div ng-repeat="text in childsub.text"> 
       <span>{{text.name}}</span> 
      </div> 
     </div> 
    </div> 
0

Im zweiten div Kind hat kein Attribut namens "Kinder". Sie haben ein Attribut namens "childrens". Verwenden Sie einfach Kinder anstelle von Kinder in der zweiten div und es sollte funktionieren.

Verwandte Themen