I want to show a div when a input-radio is selected.
<div>
<div class="radio c-radio">
<label>
<input type="radio" name="specialType" ng-model="vm.specialType.closed" />
<span class="fa fa-check"></span>First Radio
</label>
</div>
<div ng-show="vm.specialType.closed">
<label>Day: </label>
<input type="date" class="form-control" />
</div>
</div>
I have 4 radio inputs like this one. I want to show & hide each one when one is checked. I tried with ng-click='someFunction()' but it's not working, anyway I dont think it's the best way to do it.
If I check the first radio, and for example, 3rd is checked, I want to hide the one shown and show the first one.
My controller has this variable. My idea was use it for true/false (show/hide) But maybe there is a beautiful and clean solution.
vm.specialType = {
closed: false, //1st radio
open: false, //2nd radio
ownGuards: false, //3rd radio
foreignGuards: false //4th radio
};
divswith ng-click() but now I cant. Maybe something like ng-checked or similar? I dont know