I have an AngularJS 1.0.7 web app. I have a javascript plugin that I just want to execute in production environment (related with Google Analytics).
I have an ENVIRONMENT constant with different values according to environment, so my idea is to do something like:
<head>
<script ng-show="ENVIRONMENT == 'Production'">
javascript code
</script>
</head>
or same with ng-switch
.
However none of the seems to work, because I think they are rendered anyway, so finally the Google Analytics code is executed in every environment.