Dropdown binding using ng-options

Kmandapalli
Posted by Kmandapalli under AngularJS category on | Points: 40 | Views : 538
<script type="text/javascript">
var app = angular.module('sampleapp', [])
app.controller('samplecontrol', function ($scope) {
$scope.sample = [{
id: '1',
name: 'JavaScript'
}, {
id: '2',
name: 'JQuery'
}, {
id: '3',
name: 'AngularJS'
}];
});
</script>
</head>
<body data-ng-app="sampleapp" data-ng-controller="samplecontrol">
<form id="form1">
Select Name: <select ng-options="s.id as s.name for s in sample" ng-model="col">
<option value="">--Select--</option>
</select>

Comments or Responses

Posted by: Jayakumars on: 7/27/2015 Level:Bronze | Status: [Member] [MVP] | Points: 10
Hi
Can you post full code

Login to post response