-
Notifications
You must be signed in to change notification settings - Fork 1
Quick Start
Maxime LUCE edited this page Feb 25, 2014
·
1 revision
KoUtils have to be used with an AMD library like require.js. We think that AMD Loading is a necessary thing in modern javascript application developpement, that's why we are providing KoUtils as an AMD optimized library.
We are thinking at providing a built version in next releases.
// app/main.js
require.config({
paths: {
knockout: 'path/to/knockout',
underscore: 'path/to/underscore',
koutils: 'path/to/koutils'
}
});// app/viewmodel1.js
define(["koutils/changetracker"], function(changeTracker) {
var obs = ko.observable(),
tracker = new changeTracker(obs);
tracker.hasChanges(); // false
obs("newValue");
tracker.hasChanges(); // true
});