Thanks to visit codestin.com
Credit goes to github.com

Skip to content

_.template incompatibility with Underscore.js #16

@thorlarholm

Description

@thorlarholm

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions