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

Add the ability to register bindings after instantiation #11

Merged
merged 1 commit into from
Sep 16, 2012

Conversation

mberkom
Copy link
Contributor

@mberkom mberkom commented Sep 15, 2012

Added this.registerBindings function. It accepts an additional bindings object to be added to the binding provider's binding list.

This allows individual KO modules register their own bindings before applying them in their specific portion of the dom.

var bindings = { ... }

ko.bindingProvider.instance = new ko.classBindingProvider(bindings);

ko.bindingProvider.instance.registerBindings({
  ...
})

…to the binding provider's binding list.

Allows for bindings to be added by individual modules loaded later that need to be able to bind their own bindings in their own ko instance.
rniemeyer added a commit that referenced this pull request Sep 16, 2012
@rniemeyer rniemeyer merged commit 505f733 into rniemeyer:master Sep 16, 2012
@rniemeyer
Copy link
Owner

While one could just extend ko.bindingProvider.instance.bindings directly, I think that it is fine to include the registerBindings API to simplify the call. Change is merged with specs/docs.

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

Successfully merging this pull request may close these issues.

2 participants