-
Notifications
You must be signed in to change notification settings - Fork 0
Add support for deployUrl #143
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
Comments
If possible it would also be nice if the deploymentUrl can be made available in the application itself. As for instance I'm using configuration that relates to the deployment url as startng path. Another option would be to use a macro ${angular.deployUrl} in the generation of the code so that it can be replace in run time? |
I haven't checked, and it isn't immediately obvious from the standard, but since
Thanks for mentioning this. L.E. I just realized that the above won't work unless you take an element from the DOM, see:
|
I;m using two parameters the deploy url and the base-href which I then manipulate in the index.html As the -- variables are passed on to the server.ts I can use them with providers within my app to retrieve, this enables me to use hardcoded language specific configuration files that are relative to the deploy-url. The deploy-url is passed in the SSR engine with a provider so that I can retrieve it on the server. I'm using transfer states to get the url if the client is booted in the browser. By using the APP_NAME I can have one script that starts multiple different apps as every app is outputted to dist/<app_name>. So I hope I made clear why I need the deploy-url and it should be run time available so that I can move my app's under multiple url's without rebuilding. The only problem which I now have is that I need to start multiple server modules. I'm still trying to find a solution to load a language build within the same server so that I don't need a deployment per language but can use one nodejs server which hosts multiple languages/multiple apps. |
I would go with some different translation system that allows you to change the language at runtime, @ngx-translate/core is a good one, but you should probably replace the default pipe, since it does a lot of work during Change Detection. And I think that SSR should work out of the box, just make sure to add the language codes in the URL. |
Closing, deployUrl is now deprecated: angular/angular-cli@e95ecb8 |
Uh oh!
There was an error while loading. Please reload this page.
Why
Currently, the application works properly only on the domain or subdomain root. If it's moved to a subpath, various resources that contain URLs that start with slash (assets paths,
window.href
"forced-reloads") won't workWhat
IEnvironmentConfig.appBaseUrl
to use Angular CLI--deployUrl
flag when it's properly implemented--deployUrl
flag when using--localize
angular/angular-cli#17737The text was updated successfully, but these errors were encountered: