-
Notifications
You must be signed in to change notification settings - Fork 4
Button convention
AndersMalmgren edited this page Jan 18, 2013
·
8 revisions
All objects of type function can be bound to a button element.
<button data-name="save">Save</button>
The convention will also look for a function guard member on the ViewModel which by convention is prefixed with can
TestViewModel = function() {
var self = this;
this.save = function() {
self.canSave(false);
};
this.canSave = ko.observable(true);
};
Anchor support is not built in to the library because enable and disabling of anchors are not supported by KO, here is a way of doing it http://jsfiddle.net/xCfQC/4/