在我的應用程序具有UI的選擇:價值的角度UI選
<ui-select ng-model="flat.flatData.type_local" theme="bootstrap">
<ui-select-match placeholder="Type">
{{ $select.selected.type }}
</ui-select-match>
<ui-select-choices repeat="t in flat.type_local | filter: $select.search">
{{ t.type }}
</ui-select-choices>
</ui-select>
艇員選拔的東西,我想的選擇值添加到數據庫之後。
在我使用輸入之前,並沒有添加到數據庫的問題。
<input type="text" class="form-control input-sm" name="type" ng-model="flat.flatData.type_local" placeholder="Type" required>
這是我的控制器的一部分:
angular.module('flatCtrl', ['flatService', 'ui.grid', 'ui.grid.resizeColumns', 'ui.grid.moveColumns', 'ui.grid.autoResize', 'ngSanitize', 'ui.select'])
.controller('FlatController', function(Flat, socketio){
vm = this;
vm.createFlat = function(){
vm.message = '';
Flat.create(vm.flatData)
.success(function(data){
// clear up the form
vm.flatData = '';
vm.message = data.message;
});
};
vm.type_local = [
{ type: 'One' },
{ type: 'Two' }
];
什麼工作不準確? – vinayakj
當我點擊提交時,我沒有在數據庫中選擇這個值。沒有flat.flatData.type_local –
如果我使用輸入,我沒有問題 –