I'm using the following to attempt to stop adsense ads from loading in angular"
<div class="" ng-if="window.location.host.indexOf('localhost') < 0">
ads here
</div>
The script logs okay in the console but doesn't work when live. Is this due to the difference between the time the check ran and the resolved host? Or should I be using something like:
<div class="" ng-if="$location.host().indexOf('localhost') < 0">
ads here
</div>
Thanks
In your controller, you can define something like:
and in your HTML