👨🏫 Co-Founder of This is Learning, Organizer of AarhusJS
✍️ Writer, Speaker, FOSS Maintainer 📗 Author
🏆 Microsoft MVP 🌟 GitHub Star
🌊 Nx Champion 🦸 Angular Hero of Education
That's one option. Another option is to load an api-environment.json file (name doesn't matter) in main.ts before bootstrapping your Angular application and providing it as a value for an InjectionToken which is then used throughout services in your applications. Your CI/CD system can write a value to this file as part of deployment or you can make a server manage it.
👨🏫 Co-Founder of This is Learning, Organizer of AarhusJS
✍️ Writer, Speaker, FOSS Maintainer 📗 Author
🏆 Microsoft MVP 🌟 GitHub Star
🌊 Nx Champion 🦸 Angular Hero of Education
This is covered in the AOT compilation chapter of my book, Accelerating Angular Development with Ivy. Alternative strategies are covered by a few articles by other authors, including the search for Angular Continuous Delivery, and Angular feature flags or something like that. Similar problem domain.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
That's one option. Another option is to load an api-environment.json file (name doesn't matter) in main.ts before bootstrapping your Angular application and providing it as a value for an InjectionToken which is then used throughout services in your applications. Your CI/CD system can write a value to this file as part of deployment or you can make a server manage it.
Thanks for replying, can you kindly point to me towards some resources that will help solve this problem.
This is covered in the AOT compilation chapter of my book, Accelerating Angular Development with Ivy. Alternative strategies are covered by a few articles by other authors, including the search for Angular Continuous Delivery, and Angular feature flags or something like that. Similar problem domain.