You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
As a follow up on my own post on stackoverflow submitting an issue here.
Problem statement
After upgrading to 1.3 version, there seems to be an issue with ng-option directive with ng-model. When the model is set prior to the asynchronously set collection bound to the ng-option and when the model is a decimal value (works fine with integer).Rendered select seems to display as nothing has been selected. No issue in FF, i see issue in IOS safari, IE and chrome at least.
.controller('MainCtrl', function($scope , $timeout) {
$scope.selected = {item: 2.5}; //setting an integer options works just fine example item:2
//Returns a promise which is resolved with the data/async call simulation
function getData(){
return $timeout(function(){
return [{value:"0",id:0},{value:"0.5",id:0.5},{value:"1",id:1},{value:"1.5",id:1.5},{value:"2",id:2},{value:"2.5",id:2.5},{value:"3",id:3}]
});
}
getData().then(function(data){
$scope.items = data;
});
});
and
<select ng-model="selected.item" ng-options="item.id as item.value for item in items"></select>
@rinatio Thanks for pointing that out, Yes you are right. It seems weird in that case as well, "2" works "2.5" does not. I have not got a chance to debug in yet.
As a follow up on my own post on stackoverflow submitting an issue here.
Problem statement
After upgrading to 1.3 version, there seems to be an issue with ng-option directive with ng-model. When the model is set prior to the asynchronously set collection bound to the ng-option and when the model is a decimal value (works fine with integer).Rendered select seems to display as nothing has been selected. No issue in FF, i see issue in IOS safari, IE and chrome at least.
As you can see here:
and
Some observations:
track by item.id
works fine.selected
attribute on DOM inspection (of the rendered select options) of issue scenario.Works fine when id is as string as well.Same issue even if it is a string, "2" works but "2.5" doesn't.The text was updated successfully, but these errors were encountered: