Home
Tutorials
Microsoft Technologies Tutorials
Java Programming Tutorials
Web Designing Tutorials
Script Programming Tutorials
Database Programming Tutorials
Mobile Technologies Tutorials
Other Programming Tutorials
Examples
Articles
Tools
News
AngularJS Ng-Options to Bind DropdownList Example
Keywords : Angularjs ng-options example, Angularjs bind select / dropdown list using ng-options example, Angularjs ng-options directive example, How to use ng-options in angularjs with example
Example
<!DOCTYPE html> <html> <head> <title> AngularJs ng-options to bind dropdown list example </title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <script> var app = angular.module('ngoptionsApp', []); app.controller('ngoptionsCtrl', function ($scope) { $scope.arrlist = [{ "userid": 1, "name": "Suresh" }, { "userid": 2, "name": "Rohini" }, { "userid": 3, "name": "Praveen" }]; }); </script> </head> <body ng-app="ngoptionsApp" ng-controller="ngoptionsCtrl" <div> <h3>AngularJS ng-options to bind dropdown list Example</h3> <select name="users" ng-options="user.name for user in arrlist" ng-model="userselected"> <option value="">--Select User--</option> </select><br /><br /> <span>User Name: {{userselected.name}}, UserId: {{userselected.userid}}</span> </div> </body> </html>
Click Here to See Result
Result
Previous
Next