How to add common api url link to environment page in angular

step1) add url to your environment.ts.
 
export const environment = {

production: false,
apiUrl: 'www.localurl.com'
};

step2) add same url to your environment.prod.ts
export const environment = {
production: true,
apiUrl: 'www.productionurl.com'
}; Now when you build for production like ng build --env=prod it will automatically use production url and when you build for local use like ng build it will use local url.

Comments

Popular posts from this blog

how to save images with angular nodejs

How to export data to excel sheet with colors and style in angular.