Is there a way to set up a dynamic ng-repeat
in $scope variable that looks like this:
$scope.radioOptions =[{value:1,name:'radio1'},{value:2,name:'radio2'}];
$scope.item = {
model: "radio",
radioOptions:'opt in radioOptions',
optValue:'value',
optLabel:'name'
}
and then utilize it in the html code:
<div class="radio radio-info radio-inline" ng-repeat="item.radioOptions">
<input type="radio" id="{{$index}}" ng-value="item.optValue" name="{{item.model}}">
<label for="{{$index}}">{{item.optLabel }}</label>
</div>
This is producing an error message:
Error: [ngRepeat:iexp] http://errors.angularjs.org/1.4.8/ngRepeat/iexp?p0=item.radioOptions
How can I properly create a dynamic ng-repeat
with these specifications?