-2
<input type="number" ng-model="limit"/>
<button ng-click="runNames()" />
<div style="height:150px;width:150px" class="boxed" ng-repeat="name in names">
{{name|uppercase}}
</div>
mainModule.controller('helloWorldController', ['$scope', function ($scope) {
$scope.runNames = function() {
$scope.names = [];
for (i = 0; i < $scope.limit; i++) {
$scope.names.push("pratik");
}
};
}]);
什麼錯誤?你期待它做什麼?這不是程序員應該如何提出有關代碼的問題。學習如何提出問題應該調試101. http://blog.codeunion.io/2014/09/03/teaching-novices-how-to-debug-code/ – BenCr 2014-09-11 10:34:04