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

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

Closed
isadovskiy opened this issue Jul 1, 2014 · 0 comments · Fixed by #1330
Closed

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

isadovskiy opened this issue Jul 1, 2014 · 0 comments · Fixed by #1330
Assignees
Labels
Milestone

Comments

@isadovskiy
Copy link

Please check this example: http://jsfiddle.net/a35ZH/1/

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
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants