Introduction:
Here I will explain how to get selected value from dropdown list in AngularJS or get dropdown list selected value using AngularJS. To get dropdownlist selected value in AngularJS we will use ng-model option to get selected value.
Description:
In previous articles I explained bind dropdownlist in angularjs, Angularjs convert lower case to upper case while typing text, Angularjs refresh div for every 1 second using interval mode and many articles relating to AngularJS, jQuery, JavaScript and asp.net. Now I will explain how to get dropdownlist selected value using AngularJS.
In previous articles I explained bind dropdownlist in angularjs, Angularjs convert lower case to upper case while typing text, Angularjs refresh div for every 1 second using interval mode and many articles relating to AngularJS, jQuery, JavaScript and asp.net. Now I will explain how to get dropdownlist selected value using AngularJS.
|
If you
want to check it in complete example you need to write the code like as shown
below
|
Live
Demo
To
check live demo try to change below sample dropdownlist value
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
6 comments :
It is nice but I want to know about when clicking on selected item in dropdownlist how another dropdownlist comes? Any help will be appreciable.
good one..
could you please tell me. how add multiple names and save it in database using angular js?
i've a dropdownlist, i want to select 4 different values from 4 different dropdownlist and save it in database..!!
if it is possible means please teach me or give me code...
thanks in advance..!!!!
could you please tell me. how add multiple names and save it in database using angular js?
i've a dropdownlist, i want to select 4 different values from 4 different dropdownlist and save it in database..!!
if it is possible means please teach me or give me code...
thanks in advance..!!!!
The Best and Simplest way ----------->
select data-ng-model="region" >
option ng-value="op" data-ng-repeat="op in ['Option 1','Option 2','Option 3','Option 4']" >{{op}}
/option>
/select>
For the selected option, set default option in controller
$scope.region = 'Option 1';
Hi Suresh,
I am using your code but before "--Select--" option, I am getting blank space. Wahts the reason behind this, can you suggest. I am populating data (Id & name as columns) from database.
Note: Only a member of this blog may post a comment.