-
Notifications
You must be signed in to cha 8000 nge notification settings - Fork 7.1k
_.template incompatibility with Underscore.js #16
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
I renamed it |
I'm curious did you run into this in your code or were you just scanning Lo-Dash's source? |
You are right, it does exist and is called 'object' instead of 'obj'. I did indeed run into this in my code, which is why I forked and made a change. |
Cool, that let's me know it's not just some super edge case, it's fixed now :D |
…r Underscore.js compatibility. [closes #16] Former-commit-id: da91e5c881e6b3f9e2108cc231e57c023884b251
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Underscore.js defines a default variable called 'obj' for use in referencing your JS data from your HTML templates (see https://github.com/documentcloud/underscore/blob/master/underscore.js#L1027).
lodash will read the default data variable name from lodash.templateSettings.variable, which does not exist - just like in Underscore.js.
lodash fails if an underscore template use 'obj' without explicitly setting the variable name to 'obj' in the call to _.template.
This breaks the "drop-in replacement" requirement.
The text was updated successfully, but these errors were encountered: