I'm new to CouchDB & Angular.js.
I have the following document in CouchDB.
{
"_id": "Ref_Colors",
"_rev": "1-c4c800fa1dcb510915d1c6c81c8c988c",
"Items": ["Red", "Blue", "Green", "Yellow", "White", "Black"]
}
My Controller function is
app.controller('ColorCtrl', function($scope, $http) {
$http.get('db/Ref_Colors').success(function (data) {
$scope.Colors = data.Items;
});
});
In my HTML page
<div> {{Colors}} </div>
correctly displays ["Red", "Blue", "Green", "Yellow", "White", "Black"].
But if I try to bind this array to a dropdown the dropdown box remains empty!
<select name="SelectedColor" ng-model="SelectedColor" ng-options="c for c in Colors"></select>
Kindly suggest how to properly bind drop down boxes in AngularJs.