2016-10-31 1 views

Antwort

0

Machen Sie Ihre JSON

var jsonData = [ 
        { 
        "bucket": ">120", 
        "productCodes": ["SBML", "SBHL"]     
        }, 
        { 
        "bucket": "1-30", 
        "productCodes": ["SBHL", "SBML", "SBML+"] 
        }, 
        { 
        "bucket": "X", 
        "productCodes": ["SBNL++"] 
        } 
       ]; 

und Sie sehen

<body ng-app="myApp">  
    <div ng-controller="MyCtrl" align="center"> 
     <table border="1"> 
      <tr> 

        <th>Bucket</th> 
        <th>PRODUCT_CODE</th>    
        <th>Allocated #</th>     
      </tr> 
      <tr ng-repeat="p in products"> 

        <td><span>{{p.bucket}}</span></td>          
        <td><span ng-repeat="c in p.productCodes">{{c}}</span></td> 
        <td><span>{{p.productCodes.length}}</span></td>      
      </tr>    
     </table> 
    </div>  
</body> 
</html> 
+0

u kann bei einer solchen json bitte helfen Sie mir ... Ich habe versucht, mit Unterstrich aber nicht .. könnte möglicherweise mein Ansatz war falsch .. aber danke im Voraus. –

Verwandte Themen