-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Expressions are lost on precompile #1232
Comments
This appears to be an issue I've narrowed to gulp-handlebars and will likely close this issue later today. It appears gulp-handlebars precompile either isn't compatible with handlebars 4.x or loses expressions during the compile due to evaluating them and returning an empty value (because it can't evaluate them yet). |
Can this be closed? |
Yes this can be closed. This is an issue with gulp-handlebars and effectively an issue with order of operations. Writing a precompile method using "vanilla" handlebars doesn't produce the same issue. Sorry for the late response. |
I have a contact form, for example, that I can directly render expressions like this:
And on contact.handlebars:
The div id="contact" is actually a precompiled template. This comes from my source, which is bundled and pulled in on the main layout html page using a simple
<script src="bundle.min.js">
.Everything renders, EXCEPT any expressions defined in the precompiled template. For example:
Test is defined in my route as described at the top. This is just for testing; eventually this data will be pulled from a database. In this example the
{{> exampleForm}}
is a partial that is also precompiled - just a html form - and it renders just fine, CRUD is all wired up, works fine.Just expressions do not display unless I add them to the destination, non-precompiled template. This basically makes precompiling worthless. I want to be able to output the results of the form using a template which will display four fields, ideally populated by using something like this:
But if the expression isn't preserved into the final rendered template, then the whole purpose of precompiling is worthless.
I'm sure there's a way to preserve the location of the expression without destroying it when it's precompiled. Note that NO errors are thrown in terminal or web console.
The text was updated successfully, but these errors were encountered: