Reputation: 13372
This includes setting via just
.val();
and using
.val().trigger("change");
I've tried both.
I've come up with the simplest example I can manage.
If you click the button that updates the someText observable with some random number string, the computed updates as well. If you use jQuery to change the input both the text and the computed are not updated.
What's up?
Upvotes: 1
Views: 63
Reputation: 37520
This has stumped me before. jQuery needs to be loaded before Knockout in order for change()
or trigger('change')
to change the view model.
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//ajax.aspnetcdn.com/ajax/knockout/knockout-3.0.0.js"></script>
Fiddle: http://jsfiddle.net/qP9NW/
Upvotes: 1