I am attempting to add a condition to either href or ng-href.
The condition I want to apply is if email !== null
.
My current code appears as follows:
<a ng-attr-href="{{email !== null}}" href="mailto:{{email | lowercase}}">{{email | lowercase | nullValue}}</a>
As a result, I am getting either href="true"
or href="false"
.
Although this is close to the desired outcome, the href attribute remains even when the value is null:
ng-attr-href="mailto:{{email !== null ? email : email | lowercase}}"
Is there a way to completely remove the href if the data value is null? Can the entire condition be wrapped around the html href attribute?