My question is about making src in html script tag dynamic. Now, I have something like this at the bottom of the html :
<script src="https://blabla.com/assets/jxx.js"></script>
In my angular js file, I've a method to return the url prefix dynamically.
$scope.trustSrc = function(src) {
return $sce.trustAsResourceUrl($scope.pathPrefix + src);
};
And what I want to do is transform the src part to this:
<script type="text/javascript" src="{{trustSrc('/assets/jxx.js')}}"></script>
The prefix of the url changes depending on the environment. So I need to change it dynamically.
This method works if I put the script tag in the html's head portion. But mine should be outside of the head and at the bottom of the html.
What do you recommend to do this?