July 2018
Intermediate to advanced
420 pages
8h 46m
English
As the name says, this file is used to set up environment variables in our application. The best part about it is that Angular comes with a dev and prod environment that's configured by default and is very simple to use. We can also set a variety of variables.
In this example, we are setting the backend URL using the development file.
Open the ./Client/src/environments/environment.ts file and add the following URL:
export const environment = {
production: false,
apiUrl: 'http://localhost:8081/api'
};
As you can see, we have another file called environment.prod.ts inside the environments folder.
Do not worry about this file for now, as we will only use it later in the book.
Read now
Unlock full access