Within my template, I have the following setup:
<div>
<a ng-href="tel:{{phone}}">{{ phone }}</a>
</div>
Angular updates the link's DOM node when $scope.phone
changes, linking it to the new phone number with no issues.
However, a third-party browser plugin is commonly used which replaces the phone number in the <a>
tag with a formatted version and an icon. Unfortunately, this plugin doesn't update when $scope.phone
changes, keeping the old phone number displayed.
To resolve this issue, I am considering re-attaching the entire div or link to the page whenever the phone property changes. Is there anything provided by angularjs that would make this process simpler (such as re-attaching a dom node instead of updating it)?
Currently, my solution involves temporarily setting a property $scope.reattach to true, then setting it back to false after 0 milliseconds. I then use an ng-if statement to check for this property. However, I feel like this method is not very clean.