मैं AngularJS में नया हूं। मैंने बहुत खोज की, लेकिन इससे मेरी समस्या हल नहीं हुई।
मुझे चुनिंदा बॉक्स में पहली बार एक खाली विकल्प मिल रहा है।
यहाँ मेरा HTML कोड है
<div ng-app="MyApp1">
<div ng-controller="MyController">
<input type="text" ng-model="feed.name" placeholder="Name" />
<select ng-model="feed.config">
<option ng-repeat="template in configs">{{template.name}}</option>
</select>
</div>
</div>
जे एस
var MyApp=angular.module('MyApp1',[])
MyApp.controller('MyController', function($scope) {
$scope.feed = {};
//Configuration
$scope.configs = [
{'name': 'Config 1',
'value': 'config1'},
{'name': 'Config 2',
'value': 'config2'},
{'name': 'Config 3',
'value': 'config3'}
];
//Setting first option as selected in configuration select
$scope.feed.config = $scope.configs[0].value;
});
लेकिन यह काम नहीं लगता है। मैं इसे कैसे हल कर सकता हूं? यहाँ JSFiddle डेमो है