In Angular (Type Script) there are many config files. Which is the right one to save a global setting?
For example, when I am calling API from local then my rootUr
When I first started using Angular 2, I used a global.ts file where I'd put all my variables, so that I could change it easily.
I've then discovered the environments provided by angular CLI. All you have to do is name a file environment.prod.ts
(for prod), and use ng build --prod
when you build it. when you develop, use the environment.ts
file and both files have to have the same variables.
I hope this answers your question.