KoLite 1.0.2
See the version list below for details.
dotnet add package KoLite --version 1.0.2
NuGet\Install-Package KoLite -Version 1.0.2
<PackageReference Include="KoLite" Version="1.0.2" />
paket add KoLite --version 1.0.2
#r "nuget: KoLite, 1.0.2"
// Install KoLite as a Cake Addin
#addin nuget:?package=KoLite&version=1.0.2
// Install KoLite as a Cake Tool
#tool nuget:?package=KoLite&version=1.0.2
// asyncCommand
// -----------------------------
<button data-bind="command:
saveCommand">Save</button>
self.saveCommand = ko.asyncCommand({
execute: function(callback) {
$.ajax({
complete: callback,
data: { name: self.name() },
type: 'POST',
url: '/save/',
success: function(result) {
alert('Name saved:' + result)
}
})
},
canExecute: function(isExecuting) {
return !isExecuting && self.name()
}
})
// asyncCommand and activity
// -----------------------------
<button data-bind="activity: saveCommand.isExecuting, command: saveCommand">Save</button>
// dirtyFlag
// -----------------------------
// Your model
var Person = function () {
var self = this;
self.id = ko.observable();
self.firstName = ko.observable().extend({ required: true });
self.lastName = ko.observable().extend({ required: true });
self.dirtyFlag = new ko.DirtyFlag([self.firstName,self.lastName]);
return self;
};
// Hook these into your viewmodel ...
//Property on your view model. myPerson is an instance of Person.
//Did it Change?
isDirty = ko.computed(function () {
return myPerson().dirtyFlag().isDirty();
}),
//Resync Changes
dirtyFlag().reset();
Learn more about Target Frameworks and .NET Standard.
-
- jQuery (>= 1.4.4)
- knockoutjs (>= 2.0.0)
GitHub repositories
This package is not used by any popular GitHub repositories.