Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Setting null values with an HTML <select> using AngularJS.
To set null values, here is the controller −
function display($scope) {
$scope.obj ={"selected":null};
$scope.objects = [{id: 1, value: "Yes"}, {id: 0, value: "No"}]
}
The following is the template −
<div ng-controller = "display">
<select ng-model = "obj.selected"
ng-options = "value.id as value.value for value in objects">
<option value = "">Unknown</option>
</select>
<br/>
{{obj}}
</div> Advertisements
