Code:
<label class="checkbox-inline">
<input type="checkbox" name="activeFlag" id="active"
value="active" ng-checked="flag" ng-click="flag=!flag"/>
<span ng-show="flag">Yes</span><span ng-show="!flag">No</span>
<input ng-if="::flag" type="button" style="width:85px;" value="Active"
class="btn btn-success btn-xs"/>
<input ng-if="::!flag" type="button" style="width:85px;" value="Deactivated"
class="btn btn-danger btn-xs"/>
</label>
Here as you can see, i need to toggle "Yes" to "No" when checkbox is clicked, but I don't need to change my button value once it is fixed. I tried using ::falg
, but it gives out "Active" only for any initial value of flag.
Suggest my error.