我尝试对这个对象进行ng-repeat,我尝试了几次,但仍然卡住了。如果有人有想法,是否有可能分享这种情况的提示。

[
{
    "Abonnement": {
        "id": "1",
        "nom": "BAS PRIX",
        "tarif": "2.49",
        "communication": "2h de communication",
        "vers": "vers fixes et mobiles",
        "zone": "zone nationale"
    }
},
{
    "Abonnement": {
        "id": "2",
        "nom": "NATIONAL",
        "tarif": "9.99",
        "communication": "t\u00e9l\u00e9phonie et SMS illimit\u00e9s",
        "vers": "vers fixes et mobiles",
        "zone": "zone nationale"
    }
},
{
    "Abonnement": {
        "id": "3",
        "nom": "EURO",
        "tarif": "19.99",
        "communication": "t\u00e9l\u00e9phonie et SMS illimit\u00e9s",
        "vers": "vers fixes et mobiles",
        "zone": "zone EURO"
    }
}
]

最佳答案

如果数组存储在$scope.abonnements下的作用域中,这就是使用ng-repeat的方式:

<ul>
  <li ng-repeat="item in abonnements">{{ item.Abonnement.nom }}</li>
</ul>


看到这里:http://jsfiddle.net/89b98cpd/

10-08 10:55