Allow context change after element has been rendered #180

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

Comments

Projects
None yet
1 participant
@justinbmeyer
Contributor

justinbmeyer commented Nov 29, 2012

<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

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Sep 20, 2013

Contributor

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

Contributor

justinbmeyer commented Sep 20, 2013

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