I have created an AngularJS application with select box, The application with select is working fine, but the problem is that I want option group like thing in select which is selectable, since i am aware that the option group feature in select is not selectable, I made similar stuff using CSS, when i put the values statically its working fine, but dynamically I am not able to show the child details
can anyone please tell me some solution for this
angular.module('Test1',[])
.controller('Foo', function($scope) {
$scope.regionsData = {
"regions": [
{
"regionId": 15,
"regionName": "Kerala",
"places": [
{
"placeId": 21,
"placeName": "Trivandrum"
},
{
"placeId": 22,
"placeName": "Kollam"
}]
},
{
"regionId": 16,
"regionName": "Chennai",
"places": [
{
"placeId": 23,
"placeName": "Kanchipuram"
},
{
"placeId": 24,
"placeName": "Guindy"
}]
}
]
}
});
.region {
font-weight: bold
}
.place {
padding-left: 25px;
}
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="Test1">
<div ng-controller="Foo">
<b>DYNAMIC<b><br>
HOW CAN I DISPLAY THE CHILD DETAILS<br>
<select ng-model="data.selectedDocumentType" class="region" ng-options="region as region.regionName for region in regionsData.regions"> </select>
<br><br><b>STATIC<b><br>
THIS IS WHAT I WANT TO ACHIEVE<br>
<select>
<option class="region">Kerala</option>
<option class="place">Trivandrum</option>
<option class="place">Kollam</option>
<option class="region">Chennai</option>
<option class="place">Kanchipuram</option>
<option class="place">Guindy</option>
</select>
</div>
</div>