html - binding value on event click to knockout.js not work -


i have trouble event click in knockout.js

this html code :

<button type="button" class="btn btn-primary" data-bind="click : simpan">save</button> 

javascript code:

 var viewmodel = function () {            var self = this;     self.oke = ko.observable("add");      self.simpan = function() {           self.oke = ko.observable("testing");       alert(999);     }     };  ko.applybindings(new viewmodel()); 

my expect can change value input "testing"


Comments

Popular posts from this blog

javascript - WinJS appendTextAsync producing scheduler errors -

minify - Minimizing css files -

Sockets with kotlin -