javascript - How to create knockout data bindings at runtime w/o data attributes -


is possible create knockout bindings javascript alone, i.e. without writing custom html attributes?

i'm stuck our existing markup , can't add data-bind etc. knockout.js relies on (html generated programmatically , there no access rendering pipeline, please assume i've exhausted options in trying :)

one idea i'm tentatively pursuing adding data-bind attributes @ runtime prior calling ko.applybindings. there preferred approach? i'll accept alternative, sufficiently documented/popular/stable framework if implements bindings similar knockout.js if/visible.

knockout 3.0 (which around corner , in release candidate now) opens lot more ways interact binding process, such ability preprocess nodes , dynamically generate bindings. take @ knockout.punches see examples of possible. between , things mentioned unobtrusive , class binding providers, should have no trouble working whatever markup you're stuck with.

it may worth pointing out knockout has applybindingstonode function takes in json object of bindings if want full control, though not apply bindings descendant elements.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -