{{trade}} とその親を open 関数に渡したいです。
li をクリックすると、アラート ボックスに親 (ティッカー) データと子 (トレード) データが表示されます。
ここに plunkr があります: http://plnkr.co/edit/QuG8NcOvPKVAnfRNYwlx?p=preview
html:
<table ng-controller = "TickerListCtrl">
<thead>
<th>Symbol</th>
</thead>
<tbody ng-repeat="ticker in tickers">
<tr ng-click="showTrades(ticker)">
<td>{{ticker.Ticker}}</td>
</tr>
<tr ng-show="ticker.showTrades">
<td colspan="2">
<ul ng-repeat="trade in ticker.trades">
<li ng-click="open(trade)">{{trade}}</li>
</ul>
</td>
</tr>
</tbody>
</table>
ティッカー:
$scope.tickers = [
{
"Ticker": "4512",
"TradeCount": "91",
"trades" :
[{
"one": "this one",
"two": "this two",
"three": "this three"
},
{
"one": "this one",
"two": "this two",
"three": "this three"
},
{
"one": "this one",
"two": "this two",
"three": "this three"
},
{
"one": "this one",
"two": "this two",
"three": "this three"
},
{
"one": "this one",
"two": "this two",
"three": "this three"
},
{
"one": "this one",
"two": "this two",
"three": "this three"
},
{
"one": "this one",
"two": "this two",
"three": "this three"
}]
}]