-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular 'apiUrl' in configurable json file #3536
Comments
I don't know can you change the I'll research this problem. I want to ask a question. Why you don't run a node script that gets |
Having a single build makes it much easier to deploy hundreds of times across environments or servers, or use docker containers or Traefik etc. Thanks for looking in to this! |
I can add |
Thanks for this. I have tried it and it seems to work as expected. I'd still like to be able to call getInitialData once I have updated the config, @mehmet-erim is there something you could add to bypass |
You don't need to call this.store.dispatch(GetAppConfiguration).subscribe(async () => {
// below codes refresh the page sliently. That is required.
const { shouldReuseRoute } = this.router.routeReuseStrategy;
this.router.routeReuseStrategy.shouldReuseRoute = () => false;
this.router.navigated = false;
await this.router.navigateByUrl(this.router.url);
this.router.routeReuseStrategy.shouldReuseRoute = shouldReuseRoute;
}); |
@olicooper do you found solution how to have apiUrl in configuration file? |
See: #4386 (comment) |
I'd like to deploy my angular application to different environments without having to edit the
environment.prod.ts
file and re-build for each environment. I have asked a similar question prior this (see #2669) but I wasn't able to get it working for my use case. I will try to explain below.The main issue is that the ABP
CoreModule
makes an API call to get the 'application-configuration' (using the wrong api url) before I get chance to call SetEnvironment.I need to be able to set the environment before the
CoreModule
uses the configuration butSetEnvironment
needs to be called after theCoreModule
is initialized otherwise the ngxs store isn't configured and the defaultenvironment.prod.ts
would overwrite the one passed toSetEnvironment
anyway.As a test I wrote this code to run during application initialization:
This was then used in the main AppModule:
The text was updated successfully, but these errors were encountered: