JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app>
<div ng-controller="TodoCtrl">
<select ng-model="prefix">
<option>1</option>
<option>2</option>
</select>
<select ng-model="type">
<option>typeA</option>
<option>typeB</option>
</select>
<input type="number" placeholder="輸入起始值" ng-model="start">
<input type="number" placeholder="輸入結束值" ng-model="end">
<button ng-click="enterText()">執行的按鈕</button>
<br>
<textarea cols=40 rows="20">{{result}}</textarea>
</div>
</div>
JavaScript
TodoCtrl = function($scope) {
$scope.result = ''
$scope.enterText = function(){
if ($scope.prefix == undefined || $scope.type == undefined || $scope.start==undefined || $scope.end == undefined) {
return
}
if ($scope.start > $scope.end) {
return
}
for (var i=$scope.start ;i<$scope.end+1 ;i++)
{
$scope.result = $scope.result + $scope.prefix + ':' + $scope.type + ':' + i + "\n"
}
}
}