JSFiddle - React, Tailwind, and code Playground
by Danish Farman
HTML
<div ng-app ng-controller="DescAttrCtrl">
<div ng-repeat="dattr in dattrs">
<div ng-repeat="v in dattr.values">
{{v | json}}
</div>
<br /><hr />
<select ng-model="selection" ng-options="values for values in dattr.values">
<option value=""> --- select a value --- </option>
</select>
<br /><hr />
<div>
{{selection}}
</div>
<br /><br /><hr /><hr />
</div>
</div>
JavaScript
function DescAttrCtrl($scope) {
$scope.dattrs = [
{
"name" : "first attribute",
"description" : "attribute first description",
"values" : ["value1", "value2", "value3", "value4"]
},
{
"name" : "second attribute",
"description" : "attribute second description",
"values" : ["value1", "value2", "value3", "value4"]
}
];
}