Can anyone explain why the templating tag [[ opt.option ]]
is not always evaluating to a value in this code snippet?
<span ng-repeat="opt in options">
<button ng-click="button = [[ opt.option ]]" ng-class="{ active : button == [[ opt.option ]] } ng-cloak>
<i class="icon-tick visible-in-active" ></i>[[ opt.option ]]
</button>
</span>
Although the buttons are displaying names correctly, they are not becoming active when clicked. It seems that the templating tags for ng-click
and ng-class
are not functioning as expected. Can someone help me understand why?
Edit
I had to use [[]] instead of {{}} because I am working with Django, which also uses {{}}
I would like the functionality demonstrated in THIS example, where clicking on a button activates it while deactivating the previously active one. However, my current implementation can be viewed here.