The scope variable SelectedPage is not updating.
There is a ul li for pagination, that has a dropdown & then a next button. User can go to a page either by clicking the button or choosing an option in select.
When I click on Next or select 2 in the dropdown, I'm expecting the value of $scope.SelectedPage to change to 2. But it always remains 1.
HTML:
<ul>
<li>
<select ng-model="SelectedPage" ng-change="ShowPageResult()">
<option value="1">1</option>
<option value="2">2</option>
</select>
</li>
<li ng-click="SelectedPage = SelectedPage + 1;ShowPageResult();"><a href=" #">Next</a></li>
</ul>
Ctrl.js
$scope.ShowPageResult = function () {
console.log($scope.SelectedPage); //always prints 1
}
EDIT http://jsfiddle.net/g8pLhf79/ After the page loads, click on 'Next', the no. increments. Now select a value in the dropdown and click on next. It now appends "1" instead of incrementing. I hope this helps understand the issue.