I think we shouldn’t have references to html elements in viewmodel. So I think I can’t do $(‘#id’).dialog() or shouldn’t do alert(‘message’) or window.open().
Then how should I do it?
I think we shouldn’t have references to html elements in viewmodel. So I think
Share
Take a look at this answer for a sample of using a custom binding to control a jQuery UI dialog from your view model.
integrating jquery ui dialog with knockoutjs
Setting an observable to true opens the dialog, setting it to false closes it.