Javascript / JQuery events vs knockout observable + subscribe -


is there programming scenario js / jquery events need used while using knockoutjs observable variables?

technically, no, can use ko.utils.registereventhandler instead, more technically, that's using js events.

more point (i hope), may apply jquery events within binding handler, should not doing in other app code. reason should not reaching around knockout's binding handlers manipulate view directly. binding handlers exist synchronize view , viewmodel. want view should done manipulating viewmodel. if there no way modify or access view in way want via viewmodel, need binding handler.

within binding handler, objective ensure viewmodel , view reflect each other. may use tools achieve that.

also note knockout provides event binding let viewmodel respond events view.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -