我已經在angularjs中創建了一個應用程序,這裏我有一個表,我試圖把一個動態id放在一個超鏈接的ng-init中生成動態id,應用程序工作正常,但計數不增加count在ng-repeat內不遞增
誰能告訴這個
<div ng-app="Test1">
<div ng-controller="Foo">
<span ng-repeat="section in sectionData.sections">
<span ng-repeat="regions in section.regions">
<span ng-repeat="places in regions.places">
<a ng-init="count++" href="javascript:void(0);" ng-click="getClick(count)">Click</a>
<table id="{{count}}" border="1">
<tr><td>{{places.placeName}}</td></tr>
</table>
</span>
</span>
</span>
</div>
</div>
但表格ID不正確 – 2014-09-23 12:36:21
{{places.id}}在表格元素的id屬性上更改{{count}} – laurent 2014-09-23 12:38:45
嘿,這很好用......謝謝 – 2014-09-23 12:49:11