Reputation: 192
Is there a way with angular2+ to change the url of all static resource requests (for example an image src in DOM)? The goal is to change the url of a resource from "assets/images/image.jpg" to "/app-name/assets/images/image.jpg". I have found httpInterceptors but it works only with api requests.
Upvotes: 0
Views: 276
Reputation: 211
You can use base <base href="/antpath/">
in your index.html
then the value in href (/antpath/) will be appended to all your request.
Upvotes: 1