dimanche 17 avril 2016

AngularJS checkbox checked disable other checkbox based on value from ng-repeat

Here i like to explain my problem clearly,

i have list of checkboxes which generate from json file displaying using ng-repeat.

Checkbox list

above image shows the list of checkbox, now what i need is by default i need to disable 1BHK,2BHK,3BHK,4BHK,1Room,2Room,3Room,1Bathroom,2Bathroom,3Bathroom

after selecting In-depth home cleaning, i need to enable 1BHK,2BHK,3BHK,4BHK In this 1BHK,2BHK,3BHK,4BHK users is allow to only one in this 4 option.

after selecting Room Cleaning, i need to enable 1Room,2Room,3Room In this 1Room,2Room,3Room users is allow to only one in this 3 option.

after selecting Bathroom Cleaning, i need to enable 1Bathroom,2Bathroom,3Bathroom In this 1Bathroom,2Bathroom,3Bathroom users is allow to only one in this 3 option.

Below is my code

<div class="checkbox">
       <label ng-repeat="specific in specifications">
       <input ng-disabled="specific == '1 BHK'" id="specifications_chk" value="{{specific}}" ng-model="newObject[specific]" type="checkbox">
            {{specific}}
       </label>
</div>

Help me am stuck with this, help will be really appreciated




Aucun commentaire:

Enregistrer un commentaire