こんにちは、私はAngularを初めて使っています。私よりも知識のある人からフィードバックが必要です。私は詳しく問題を説明します。テーブルを作成する必要があります。大部分のケースでは、ng-repeatを使用して一連のデータをループします。しかし、今回はデータ構造が異なるため、APIでは配列ではなく文字列とネストされたキーの代わりにキーが返されます。最後のレベルには配列が含まれています。私はATLAである最初のキーを表示することができる午前最初のNGリピートで配列の代わりにネストされたキーで角度1.5 ng-repeat
データ
{ATLA:
{NECBTEST2012:
{FRMFM-HD:
[{date:"2017-09-27", run_rate:23},
{date:"2017-09-28", run_rate:23}]
}
}
}
HTML
<table >
<thead>
<tr>
<th> Market</th>
<th> </th>
<th>Average</th>
</tr>
<tr>
<th ><form >
<input type="text" class="form-control" placeholder="Filter market">
</form></th>
<th> </th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat-start="(key, value) in rc.runRate">
<td>{{key}}</td>
<td> </td>
<td> </td>
</tr>
<tr ng-repeat-end class="slide-toggle-js">
<td colspan="3" >
<div class="toggle-me" >
<table>
<thead>
<tr >
<th>Syscode</th>
<th>Network</th>
<th>Date</th>
<th>Average</th>
</tr>
<tr>
<th>
<form>
<input class="form-control" placeholder="Filter Syscode">
</form>
</th>
<th>
<form>
<input class="form-control" placeholder="Filter Network">
</form>
</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody ng-cloak>
<tr ng-class-odd="'stripe-row-odd'" ng-class-even="'stripe-row-even'" ng-repeat="(key, value) in key">
<td>{{key}}</td>
<td></td>
<td></td>
<td> </td>
</tr>
</tbody>
</table>
</div>
望ましい結果
しかし、テーブル行では、私が私にしようとすると私はできないFRMFM-HDである次の鍵を介してテイトしてください。私は学び、より良いプログラマになりたい、より多くの知識と任意の返済を持つ人はありがとうと感謝されます!
、今私は、私がアクセスできるか、NECBTEST2012である第二のキーを表示することができます3番目のキー?値の引数を使用しましたが、代わりにすべてのオブジェクトが表示されます。あなたの時間をとり、私の質問にお答えいただきありがとうございます – hwe
rc.runRate [key] [subkey] –