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

The inline templates in the views (stuff.coffee) hurts the zen aura of the code #1

Open
clyfe opened this issue Dec 24, 2010 · 0 comments

Comments

@clyfe
Copy link

clyfe commented Dec 24, 2010

Having heredoc literal string templates inside the .coffee views /app/views/**/view.coffee is obtrusive.
Have you thought of using something similar to ICanHaz ( https://github.com/andyet/ICanHaz.js ) ie.:

# some.html
<script type="text/template" id="todo-template">
    <span><%= name %></span> ...
</script>

# some_view.coffee
template: _.template($('#todo-template').html())

or maybe have an /app/templates dir where to store the view templates as ejs strings ie. /app/templates/posts/list.html.ejs and read it in the Backbone view

# some_view.coffee
template: _.template(R.read_the_view_somehow('list'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant