Hacker News new | ask | show | jobs
by scriby 4617 days ago
In response to your #4, check out the stopBindings option. It provides a pretty simple pattern where you can wrap your knockout bound components in a stopBindings, then you don't have to worry about other binds on the page interfering with them.

See here: http://stackoverflow.com/questions/9254632/how-to-stop-knock...

Also note that you can configure it as a virtual element, so you can use the <!--ko stopBindings: true--> syntax.

1 comments

Ah, that is useful! I never knew about that binding - good to know!

(Though the Frontend guys will complain about another 'logic binding' in their Views... I don't know what I can do about that other than to point out that the benefits are worth having those in the views. Virtual elements or not, these kinds of bindings annoy them. I see it as the price you pay for all of the benefits personally, but I'm a person who can't stand hunting for arbitrary jQuery bindings to figure out why a behavior occurred.)