Issue: can.view(function, deferred, callback) does not work #1139

isadovskiy opened this Issue Jul 1, 2014 · 0 comments


None yet
3 participants

Please check this example:

Basically, can.view() currently accepts renderer function as a first parameter. But in this case view does not enter defferreds logic work flow.

Here is a part of the view method from can/view.js, version 2.1.2:

    if( isFunction(view) ) {
        result = view(data, helpers, callback);
    } else {
        result = $view.renderAs("fragment",view, data, helpers, callback);

As you can see, if renderer is a function, view renders it immediately and does not check for deferreds. Thus it's not possible to use pre-compiled templates with deferred data in such way.

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