Angular 11
I know that this question has been asked before but I can find no satisfactory answer.
In angular Cli I want to run the command
ng serve -o --client=someclient
within an component.ts file or a service.ts file I want to access the client variable thus
if (client){
this.loadClientConfig(client);
} else {
this.loadClientConfig('whitelabel');
}
loadClientConfig(c){
// go load the client config section from a config.json file if it exists (this bit i know how to do)
}
I know this can be done by adding --configuration=someClient but as far as I can tell I then need to add a new configuration section to the angular.json file and a new environment.ts file for every client and I don't want to have to do that.
is there a way to do this?
thank you.