I've got a simple page selector I'm using in an Angular 1.5 page. The select works for the most part, but the ng-selected part does not.
If I'm on page 3, (which is ironically the last page, not sure if that matters) 3 is selected by default. If I'm on page 1 or 2, the first item (blank) is selected. I'm not super versed in Javascript, but figured it might be a type issue. Tried settings $scope.thisPage with parseInt(page) and page.toString() just in case it did something under the sheets I wasn't aware of, but it all turned out the same.
app.controller('myCtrl', ['$scope','$route','$routeParams', function($scope,$route,$routeParams) {
$scope.pages = [];
var page = $routeParams.p ? $routeParams.p : 1
$scope.thisPage = page;
for (var i = 0; i < 5; i++) {
$scope.pages.push(i);
}
}]);
<form name="myForm">
<select ng-model="selectedPage" ng-change="switchPage(selectedPage)">
<option ng-repeat="p in pages" ng-value="{{p}}" ng-selected="{{p == thisPage}}">{{p}}</option>
</select>
</form>