标签:ng-repeat 迭代器 angular repeat
<div ng-repeat="answer in answers">
<ons-button class="button button--large--cta" ng-click="pushPage2($index+1)">
{{answer}}
</ons-button>
<br />
</div>
module.controller(‘Page2Controller‘, function($scope) {
$scope.answers=["aa","bb","cc"];
$scope.pushPage2 = function(index) {
alert(index);
}
});
标签:ng-repeat 迭代器 angular repeat
原文地址:http://blog.csdn.net/yy1300326388/article/details/44173361