我有JSON数组。我需要在angularjs中使用ng-repeat来获得特定的参数值。我尝试使用过滤器和其他方式,但我没有得到价值。如何从angularjs中使用ng-repeat获取json的特定参数值
这里是我的JSON
{
"UserId":0,
"Name":null,
"ResponseStatus":null,
"Category":[{
"Id":0,
"CategoryName":"Category 1",
"Property":0,
"SubCategory":{
"SubCatId":"5600",
"SubCatName":"Sub1"
}
}]
}
当我用 <p data-ng-repeat="(key,data) in input.model.Category[0].SubCategory">{{key}} :{{data}}</p>
它给人这样的结果。
<p>SubCatId :5600</p>
<p>SubCatName :Sub1</p>
但我想只有SubCatId :5600
采用NG-重复,因为我想显示不同的地方,这两个值。
请勿使用中继器。 '
SubCatId:{{input.model.Category [0] .SubCategory.SubCatId}}
' – Phil