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

Support template engines that return DOM elements #742

Closed
reno1979 opened this issue Mar 6, 2014 · 1 comment
Closed

Support template engines that return DOM elements #742

reno1979 opened this issue Mar 6, 2014 · 1 comment

Comments

@reno1979
Copy link

reno1979 commented Mar 6, 2014

When my templating enginge (CANJS) renders a template it returns a DocumentFragment, can Typeahead handle this?

(also more efficient than normal HTML appends )

ok, this solution works

can.compile = function(templ) {
      return function (ctx) {
                var divElm  = document.createElement('div');
                divElm.appendChild(can.view(templ, ctx));
                return divElm.innerHTML;
            }

    } 
@jharding
Copy link
Contributor

jharding commented Mar 7, 2014

This isn't currently supported but I think it may be pretty easy to add make this possible.

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

No branches or pull requests

2 participants