I have an element with an ng-click event that, when clicked, adds a div which works fine. My goal is to remove the ng-click event after adding the div.
One solution is to use ng-if:
<div ng-click="addDiv()" ng-if="!divAdded" >
<span>I add a div</span>
</div>
<div class="disabled" ng-if="divAdded" >
<span>I add a div</span>
</div>
However, using this method requires adding multiple divs for a single element that toggles on and off. Is there any way to dynamically unbind a click event like we do in jQuery?
Any assistance would be greatly appreciated.