If there is a element test-me
for example which takes URL
has attribute. That URL attribute should change depending on checkbox. If one checkbox is clicked then url1 should be displayed whereas if 2nd checkbox is clicked then 2nd url should be displayed.
Right now I do it this way,
<input type="checkbox" ng-model="chk1"> Check1
<input type="checkbox" ng-model="chk2"> Check2
<test-me url="url1" ng-show="chk1"></test-me>
<test-me url="url2" ng-show="chk2"></test-me>
The problem with above approach is that if I have 10 checkboxes then there will be 10 test-me
elements. How can I do this the better way so that I supply the URLs in a way depending on the checkbox value or something but there will be more modularity.
Aucun commentaire:
Enregistrer un commentaire