Question: Angular2 configuration data with transform


Angular2 configuration data with transform

Answers 0
Added at 2016-01-12 21:01

I am creating an Angular2 application that will be using a webApi. What is the best practice for handling configuration data? I would like a way to do a transform as I deploy to different environments.

When working locally the webApi will be local such as: http://localhost:64551/Api/person.

In Dev it will be:

Prod will be:

I can't hard-code the server name. I need it in a configuration, but it will change as we deploy to different environments.

This is an Anglar2 project that I am building inside an 5 project using Visual Studio. The WebApi is an 5 project. I will be hosting at Azure.

In the past, I have used web.config transforms but that's not an option for the angular app.

Any advice?

Answers to

Angular2 configuration data with transform

Source Show
◀ Wstecz