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

return just the render method? #1

Closed
millermedeiros opened this issue Jun 18, 2012 · 1 comment
Closed

return just the render method? #1

millermedeiros opened this issue Jun 18, 2012 · 1 comment

Comments

@millermedeiros
Copy link
Owner

I never really needed to access the other properties of the Template besides render() I guess it would be better to simply return the render() method so it could be used like this:

define(['hgn!foo'], function(foo){
  console.log( foo({lorem:"ipsum"}) );
});
@mattdeclaire
Copy link

I found this feature confusing. I was expecting back vanilla Hogan.Template objects. I'm loading a bunch of templates into a map, and trying to send them as partials into render() calls. I see you have a workaroundin #7, but that means remapping all my partials each time.

I ended up reverting the templates myself:

$.each(templates, function(name, template) {
    templates[name] = template.template;
});

I realize changing this now would break existing code, but could you add a config flag to remove this feature?

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

No branches or pull requests

2 participants