You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The haml_coffee_assets wiki and README give a pretty clear example of how to extend the global context by overriding HAML.globals. However, I believe those examples are not really relevant to the case where we're using AMD.
The README also references the global_context_asset for server-side rendering or customizing the context function itself. I'm not interested in server-side rendering at the moment, and it's unclear to me how the script loading order would work in the event of customizing the context function itself.
I've started looking at the code to try to decipher all this, but I haven't managed to dig it out yet and it occurs to me that this is an issue others will likely face as well.
Could you please add a simple example of using the global context when using the AMD version of haml_coffee_assets?
The text was updated successfully, but these errors were encountered:
I'm not familiar with AMD and do not use it myself. Support has been developed on popular request and I never got any feedback afterwards, so I'm not sure how people are using it.
You can have a look at the relevant code in the Haml_Coffee_Assets wrapper for Haml-Coffee here: https://github.com/netzpirat/haml_coffee_assets/blob/master/lib/js/haml_coffee_assets.js#L84-L93 If AMD is enabled and the hc module is present (which is included by default), we simply call the context method on the hc module. You'll find the default module implementation here. I do not have a clue how overwriting this in the asset pipeline and AMD works, but I guess user assets have precedence over gem vendor assets, so you might just want to copy over hamlcoffee_amd and modify it to your needs.
The haml_coffee_assets wiki and README give a pretty clear example of how to extend the global context by overriding HAML.globals. However, I believe those examples are not really relevant to the case where we're using AMD.
The README also references the global_context_asset for server-side rendering or customizing the context function itself. I'm not interested in server-side rendering at the moment, and it's unclear to me how the script loading order would work in the event of customizing the context function itself.
I've started looking at the code to try to decipher all this, but I haven't managed to dig it out yet and it occurs to me that this is an issue others will likely face as well.
Could you please add a simple example of using the global context when using the AMD version of haml_coffee_assets?
The text was updated successfully, but these errors were encountered: