-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Conditional template logic in index.html for beta.11-webpack #1544
Comments
It has been removed, yes. My suggestion for those tokens is to use the environment files feature: https://github.com/angular/angular-cli#build-targets-and-environment-files. It won't allow you to have different index.html content, but will allow you to customize tokens and whatever other code you put in each. For things you absolutely 100% need to load remotely, my recommendation for now is https://github.com/ded/script.js. |
So how can the index.html/index.ejs be transformed? With no access to environment variables or webpack config, this seems extremely limiting. The addition of the --base-href flag seems to illustrate pretty strongly that a precompile stage needs to be exposed. |
@awexfwex did you end up getting Handlebars to work with Angular4? I am in the same boat with trying to get some items from a service and into the head tags on index.html. It is very easy with Handlebars/Express in my tests but I am looking to put it all together with Angular. |
@jrmcdona We stopped using the cli, and set things up the old fashioned way. The decision was for finer control over easier configuration. I haven't kept up with the angular-cli project, so not sure if this is possible now or not. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Version 1.0.0-beta.11-webpack
Issue Handlebar template processing removed?
Detail
As noted in the https://github.com/angular/angular-cli/blob/master/WEBPACK_UPDATE.md document, the handlebar template logic was removed from index.html. It looks like there is no longer support for conditional logic in the index.html file using handlebars. Is that correct?
Including something like
{{#if environment.production}} Only show in production build. {{/if}}
the template is not processed. Has this feature been removed (or will it be)? I think this is an incredibly useful feature for including things like Google Analytics, Facebook, etc with API keys.The text was updated successfully, but these errors were encountered: