This is a code I have written:
<label><input ng-model="filter['category']['auto']" value="auto" type="checkbox" name="category">Auto</label>
<label><input ng-model="filter['category']['music']" value="music" type="checkbox" name="category">Music</label>
This code belongs to the controller section:
$scope.filter = {};
I use this filter to sort and display content, which works well. However, I now want to switch from using checkboxes to radio buttons for single category selection. I attempted the following code:
<label><input ng-model="filter['category'][type]" value="auto" type="radio" name="category" ng-change="type='auto'>Auto</label>
<label><input ng-model="filter['category'][type]" value="music" type="radio" name="category" ng-change="type='music'">Music</label>
Unfortunately, this new code doesn't seem to work as intended.