Skip to content
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

1.7.0 broke templates? #1857

Closed
marblemass opened this issue Sep 18, 2014 · 2 comments
Closed

1.7.0 broke templates? #1857

marblemass opened this issue Sep 18, 2014 · 2 comments
Labels

Comments

@marblemass
Copy link

I was using 1.6.0 and just updated to 1.7.0. Templates don't seem to be working anymore in the new version. Here is a simple test:

<html>
<head>
    <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
    <script src="underscore.js"></script>
</head>
<body>
    <div class="test"></div>
</body>
</html>


<script>
$(document).ready(function() {
    var temp = "<div> <%= x %> </div>";
    var x = _.template(temp, { x : "Hello world" });
    $(".test").append(x);
});
</script>

When rendered in the browser, nothing shows up when using 1.7.0.

If I switch back to 1.6.0, I'll see "Hello world" appended to my test div.

@akre54
Copy link
Collaborator

akre54 commented Sep 18, 2014

Yep. This behavior was changed in 1.7.0, see the changelog or do a search through the issues. You now have to do _.template(temp)({ x : "Hello world" }) which will work in 1.7.0 and 1.6.0.

@jdalton
Copy link
Contributor

jdalton commented Sep 18, 2014

Related to #1799, #1805, #1831.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants