我的代码是这样的组选定值angularJS
<body ng-app="myApp" ng-controller="MainCtrl">
<select data-ng-model="myclass" data-ng-options="color.name for color in colors">
<option value="">-- Select Freight Class --</option>
</select>
</body>
angular.module('myApp', []).controller('MainCtrl', [
'$http', '$scope', '$filter', function ($http, $scope, $filter) {
$scope.myclass = {
"name": "65"
};
$scope.colors = [{
name: '50'
}, {
name: '55'
}, {
name: '105'
}, {
name: '110'
}, {
name: '400'
}, {
name: '500'
}];
}]);
,你可以看到我试图设置此选择的默认选择的值作为65
,但它不工作。任何人都可以告诉我如何做到这一点? http://jsfiddle.net/d8kg0uys/