Everywhere throughout my website we got links and paths.
http://localhost:3001/controllers/getUsers
http://localhost:3001/controllers/getHouses
http://localhost:8080/assets/img/mypic.png
http://localhost:8080/assets/img/yourpic.png
This is a problem when we switch to production server.
How would you create a "constant" with the path in angular?
const controllerPath = "http://localhost:3001/controllers/"
const imagePath = "http://localhost:8080/assets/img/"
So we can use them in all pages?
I read about these two:
app.constant('controllerPath', 'http://localhost:3001/controllers/');
app.value('controllerPath', 'http://localhost:3001/controllers/');
But then you have to remember to send all paths to all controllers on all pages.
We could put them in $rootScope but then you have to transfer that one to all pages.
Isnt there any "settings" or something similar in Angular where you can setup global constants?