I'm working on Angular JS project. It has three radio buttons as follows.
<div class="sys-form__field" layout="row"> <label class="sys-label sys-label--radio" flex flex-gt-xs="33">Choices</label> <input type="radio" ng-model="booking.model.foodType" value="vegetarian" class="sys-input sys-input__radio" title="" /> <md-button ng-click="booking.setRadio('foodType', 'vegetarian')">Vegetarian</md-button> <input type="radio" ng-model="booking.model.foodType" value="vegan" class="sys-input sys-input__radio" title="" /> <md-button ng-click="booking.setRadio('foodType', 'vegan')">Vegan</md-button> <input type="radio" ng-model="booking.model.foodType" value="nonvegetarian" class="sys-input sys-input__radio" title="" /> <md-button ng-click="booking.setRadio('foodType', 'nonvegetarian')">Non Vege</md-button> </div> These are the food choices and based on what user selects I want to show another radio button sets. This radio buttons html as follows
<div class="sys-form__field" ng-show="booking.foodSizeChoice()" layout="row"> <input type="radio" ng-model="booking.model.foodSize" value="small" title="" > Small <input type="radio" ng-model="booking.model.foodSize" value="medium" title="" > Medium <input type="radio" ng-model="booking.model.foodSize" value="large" title="" > Large If user selects vegetarian , I only want to show small radio button. If user selects Non vegetarian I need to show only small and medium buttons. like wise how do I that?
At the moment I try like this
this.foodTypeChoice=()=> { const check2 = ()=>this.model.binType == 'small'; return check2(); } But it shows all the radio buttons. Please help