dimagi/commcare-hq — pull request #3435 by snopoke (2014-05-16 09:43:52+00:00)
Title: don't apply bindings if element doesn't exist

New to KnockoutJS 2.3 is that it will error if you attempt to apply bindings more than once on the same element. Prior to 2.3 the outcome was undefined.

Also note that if you apply bindings to an undefined element it will apply the bindings to the entire document.
e.g.
```
ko.applyBindings(viewModel, $("#element_id").get(0));
```
If the element with ID "element_id" does not exist the bindings will get applied to the entire document.

@dimagi/team-commcare-hq