-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
Cannot provide custom options.data object to template #9431
Comments
In general I would like a nice story with FormatJS. I'll need to dig into more of the literature to see what is actually being done to know if and how we can integrate better. |
Great ! Let us know your plan if you can. Thank you for that. |
Hello, I ran into the same issue for the same goal (integrating formatjs in an ember-cli addon). Thanks for taking that matter into consideration ! @bmeurant for the time being, how did you work around this limitation ? |
@ksol I did not because it was only a test, not a concrete business need. I do not see any acceptable work around for now because you will still have to override View.render :-( |
Hi there! I've been fighting to integrate Format JS and Ember in the last days and after a hard fight I just found this discussion about the issue. @bmeurant exactly, at the moment is necessary to extend View.Render, but that only solves the first part of the problem. If you explore it deeper you'll find that whenever the condition that a bound if helper (the one registered by Ember) observes is changed (so that for example a hidden part of the template is now shown), as that does not trigger rendering an Ember.View (which is the common thing unless you write every single content of an if helper as a separate view)... the Format JS-defined helpers called inside that block won't have available the intl object inside the data object. It does not get injected as the Ember.View.Render is not called. Therefore the translations are not available for the helper ... On the other hand I explored Handlebars implementation to see whether there was a feasible way to inject this data by extending some Handlebars default, or maybe overriding a method.. but so far I could only find a nice bunch of chaotic workaround that do not integrate nicely. So you and @ksol were quite right if you took the decision not to keep walking this path. :) @rwjblue actually I found this thread too, basically the same topic seen from two optics... BTW guys if anyone is already working on this, plz let me know. I will be happy to collaborate in the integration! |
BTW eventually this is going to be the same as |
this API is no more. |
Hi, I tried to add formatjs in an Ember app but it uses
options.data.intl
to store i18n messages (cf. http://formatjs.io/handlebars/#formatMessage) and providing a such object to template seams impossible becauseView.render
defines itselfoptions.data
(https://github.com/emberjs/ember.js/blob/v1.8.0/packages/ember-views/lib/views/view.js#L1048)Can we imagine a clean integration ?
The text was updated successfully, but these errors were encountered: