Answer the question
In order to leave comments, you need to log in
Angular variable change for production?
How to change some variables for production? There are addresses to which I send requests, for local development, but for production it is necessary to send requests to other addresses, how to do this?
Answer the question
In order to leave comments, you need to log in
To help you src\environments
There is environment.ts - it is used by default
When building the project:
ng build --prod
the --prod flag is substituted into the mask *.environment.ts
It is simply imported into the component:
import { environment } from 'src/environments/environment';
export class AppComponent implements OnInit {
url = environment.apiUrl;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question