I have JSON being returned that looks like this
[{"Phone_Type_Code":1,"Phone_Type_Desc":"Cell","Valid_Date":"2014-01-01T00:00:00.000Z","Expiration_Date":null},{"Phone_Type_Code":2,"Phone_Type_Desc":"Home","Valid_Date":"2014-01-01T00:00:00.000Z","Expiration_Date":null},{"Phone_Type_Code":3,"Phone_Type_Desc":"Office","Valid_Date":"2014-01-01T00:00:00.000Z","Expiration_Date":null},{"Phone_Type_Code":4,"Phone_Type_Desc":"Other","Valid_Date":"2014-01-01T00:00:00.000Z","Expiration_Date":null}]
I have a scope in my controller that looks like this:
$scope.phoneTypes = function(){
return $http.get("/api/lookup/Phone_Type").then(function(response){
return response.data;
});
};
Then a select that looks like :
<select ng-model="phoneTypes" ng-options="value.Phone_Type_Code as value.Phone_Type_Desc for (key,value) in phoneTypes">
<option value="">Select One</option>
</select>
But when I run it the break point does not even hit inside the phoneTypes method and nothing is populated. What am I doing wrong?