I'm pretty new to AngularJs and I'm locked on a little part of code:
In my UI, I've a radio button and a table (ng-grid). In my controller, I've a json array for each radio choices.
How Can I dynamically bind my table datas dependending on the selected radio button?
Example: I've a radio with A and B choices.
<div class="btn-group">
<button type="button" class="btn btn-primary" ng-model="choice" btn-radio="'A'">A</button>
<button type="button" class="btn btn-primary" ng-model="choice" btn-radio="'B'">B</button>
</div>
<div class="gridStyle" ng-grid="gridOptions">
</div>
Controllers got three arrays:
$scope.choice = 'A'
$scope.A = {name: 'A', propA: 'Aprop'}
$scope.B = {name: 'B', propB: 'Bprop'}
$scope.gridOptions = ?????
Thank you in advance.
Charlie