这是我页面的一部分
<div ng-controller="dtbCtrl" class="container">
<div class="thumbnail"><img ng-src="{{pic + selectedPitch + selectedWood}}" class="img-responsive">
<div class="caption">
<div class="col-xs-6 text-right">
<label class="hidden-xs">Registro: </label>
<button type="button" ng-model="selectedPitch" bs-options="pitch.value as pitch.label for pitch in pitches" bs-select="" animation="am-flip-x" data-placement="right-top" class="btn btn-default navbar-btn">Seleziona <span class="caret"></span></button>
</div>
<div class="col-xs-6 text-left">
<label class="hidden-xs">Legno: </label>
<button type="button" ng-model="selectedWood" bs-options="wood.value as wood.label for wood in woods" bs-select="" animation="am-flip-x" data-placement="left-top" class="btn btn-default navbar-btn">Seleziona <span class="caret"></span></button>
</div>
</div>
</div>
</div>
这来自app.js
app.controller('dtbCtrl', function($scope, $http) {
$scope.selectedPitch = 'Compara';
$scope.selectedWood = 'Compara';
$scope.pitches = [
{
value: 'compara',
label: 'Compara'
}, {
value: 'grave',
label: 'Grave'
}, {
value: 'medio',
label: 'Medio'
}, {
value: 'Acuto',
label: 'Acuto'
}
];
$scope.woods = [
{
value: 'compara',
label: 'Compara'
}, {
value: 'teak',
label: 'Teak'
}, {
value: 'padouk',
label: 'Padouk'
}
];
$scope.pic = 'http://www.placehold.it/1618x1000?text=';
});
角度带一切都很好,但没有它,移动到香草(好吧,只是角度),它没有。
<select ng-options="pitch.label for pitch in pitches" ng-model="{{selectedPitch}}"></select>
我做错了什么?为什么我在选择表单中没有选项?
答案 0 :(得分:0)
应该是ng-model="selectedPitch"
而不是ng-model="{{selectedPitch}}"
。