angularjs - based on selected option i want to display the Select fields using ionic and angular js -
in parent select option have option-1,option-2,option-3 , empty there. when ever selecting option want display below child select fields if select option 2 want display 2 selection fields below same, if select empty don't want show child selection tags.
this code don't want show static way need display dynamically
function controller ($scope) { $scope.mydropdown = ''; }
<div ng-app ng-controller="controller"> <select ng-model="mydropdown"> <option value="q"></option> <option value="one">one</option> <option value="two">two</option> <option value="three">three</option> </select> <select ng-show="mydropdown=='one'" > <option value="1"></option> <option value="111">1</option> <option value="1111">1111</option> <option value="111">1111111</option> </select> <select ng-show="mydropdown=='two'" > <option value="2"></option> <option value="222">2</option> <option value="2222">222</option> <option value="222">22222</option> </select> <select ng-show="mydropdown=='two'" > <option value="22"></option> <option value="222222">22</option> <option value="22222222">222222</option> <option value="222222">2222222222</option> </select> <select ng-show="mydropdown=='three'" > <option value="3"></option> <option value="333">3</option> <option value="3333">333</option> <option value="333">33333</option> </select> <select ng-show="mydropdown=='three'" > <option value="33"></option> <option value="333333">33</option> <option value="33333333">333333</option> <option value="333333">3333333333</option> </select> <select ng-show="mydropdown=='three'" > <option value="333"></option> <option value="333333333">333</option> <option value="333333333333">333333333</option> <option value="333333333">333333333333333</option> </select> </div>
if understand question, want select item select
, show 1,2 or 3 items in ionic list, if want, here idea that:
<div class="well" ng-show="lang1 == '1'"> <div class="form-group"> <select class="form-control" id="sel2" ng-model="lang2" ng-change="changeme()"> <option ng-option value="1">language 1</option> <option ng-option value="2">language 2</option> <option ng-option value="3">language 3</option> </select> </div> <ion-list> <ion-checkbox ng-if="lang2>=1">read</ion-checkbox> <ion-checkbox ng-if="lang2>=2">write</ion-checkbox> <ion-checkbox ng-if="lang2>=3">speak</ion-checkbox> </ion-list> </div>
here example :
edit
here want
ps: example inspire you, real solution depends on needs
edit
example
Comments
Post a Comment