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

Allow context change after element has been rendered #180

Closed
justinbmeyer opened this issue Nov 29, 2012 · 1 comment
Closed

Allow context change after element has been rendered #180

justinbmeyer opened this issue Nov 29, 2012 · 1 comment
Milestone

Comments

@justinbmeyer
Copy link
Contributor

<div data-control='controls/widget'>
      {{#todos}}
        <div>

        </div>
      {{/}}
</div>
// in controls/widget
can.Control({
  init: function(element, context){
    context.todos = Todos.findAll()
  }
})

This is very angular / knockout. Somehow, I want to be able to not call the div's "internal" function until after the div has been created. Once the div is created, I'll create the control/widget instance on it, passing the context as options to the control. The control can add items to the context. After the control is created, it will run the "internal" function with the new context.

If #179 works, the internal function to {{#todos}} will also wait until everything has finished rendering.

@justinbmeyer
Copy link
Contributor Author

canComponent branch with can.view.Scope allows this kind of thing.

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

1 participant