The select element is not bound as expected.
html:
<select ng-model="SelectedPage"
ng-change="ShowPageResult();" ng-options="o for o in PageNumbers">
</select>
ctrl.js:
function BindPageNumbers() {
$scope.PageNumbers = [];
for (var i = 1; i <= 2) ; i++) {
$scope.PageNumbers.push(i);
}
}
output:
<option value="0"label="1">1</option>
<option value="1" label="2">2</option>
if i put $scope.PageNumbers.push(i.toString());
, then the output is
<option value="?"label=""></option>
<option value="0" label="1">1</option>
<option value="1" label="2">2</option>
expected:
<option value="1">1</option>
<option value="2">2</option>
what should be done to get the desired o/p : http://jsfiddle.net/s222904f/