I have a select option and have to select default option i.e., option[0] how.?.
{{ x.community_Type }}I have get methos to receive response from server.
$http.get("http://192.168.1.10:8080/apartment/community/type/list").then(function(response) {
$scope.myData = response.data.type;
$scope.log = {community_type_id : $scope.type[0].value}; //Not working
});
community_Type data is comming from web service as :
{
"type": [
{
"community_type_id": 19,
"community_Type": "Religious Institution",
"community_type_details": "To religious leaders"
},
{
"community_type_id": 20,
"community_Type": "Religious / Common Interest Group",
community_type_details": "To religious leaders"
},
{
"community_type_id": 21,
"community_Type": "Residential Society",
"community_type_details": "To religious leaders"
}
],
"status": "success",
"message": " community type list ."
}
$scope.log.community_type_id = $scope.myData[0]