TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
How to Add a Dropdown List to an Angular Page
Pradeep Sahoo
May 15
2016
Code
973
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
<!DOCTYPE html>
<html>
<head>
<title>Adding a dropdown to an Angular Page</title>
<script src=
"https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.js"
></script>
<script type=
'text/javascript'
>
function
CityDropdownCtrl($scope) {
$scope.cities = [
'Bangalre'
,
'Chennai'
,
'Delhi'
,
'Mumbai'
,
'Kolkata'
];
$scope.SelectedCity = {
cities: $scope.cities[2]
};
}
</script>
</head>
<div ng-app ng-controller=
"CityDropdownCtrl"
>
<select ng-model=
"SelectedCity.cities"
ng-options=
"c for c in cities"
>
</select>
</div>
</html>
AngularJS
Dropdown List