JSON オブジェクト (formData) を指定して、AngularJS を使用してオブジェクトをループし、RealEstateInfoとPersonalTaxInfoを出力しようとしています。私の人生では、プロパティ名を取得する方法がわかりません。何か案は?
ちなみに (key,value) は動きません。キーは私にインデックス番号を与え、値はオブジェクト全体です。
<ul>
<li ng-repeat="item in formsData">
{{item.value}} //What goes here to get "RealEstateInfo" the 1st loop, and "PersonalTaxInfo" the second loop?
</li>
<ul>
$scope.formData = [
{
"RealEstateInfo": [
{
"Group": "General",
"Fields": [
{
"Name": "TitleType",
"Label": "Title Type",
"Type": "dropdown",
},
{
"Name": "NameIfAvailable",
"Label": "Name if available",
"Type": "string"
}]
},
{
"Group": "Personal",
"Fields": [
{
"Name": "TitleType",
"Label": "Title Type",
"Type": "dropdown",
},
{
"Name": "NameIfAvailable",
"Label": "Name if available",
"Type": "string"
}]
}]
},
{
"PersonalTaxInfo": [
{
"Group": "General",
"Fields": [
{
"Name": "TitleType",
"Label": "Title Type",
"Type": "dropdown",
},
{
"Name": "NameIfAvailable",
"Label": "Name if available",
"Type": "string"
}]
},
{
"Group": "PersonalInfo",
"Fields": [
{
"Name": "TitleType",
"Label": "Title Type",
"Type": "dropdown",
},
{
"Name": "NameIfAvailable",
"Label": "Name if available",
"Type": "string"
}]
}]
}]