KoLite
// 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();
Install
dotnet add package KoLite --version 1.0.2
Install-Package KoLite -Version 1.0.2
<PackageReference Include="KoLite" Version="1.0.2" />
Frameworks
No framework metadata available.
Dependencies
Adoption guide
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.
No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.
How to read this guidance
Sources: published NuGet v3 registry metadata and explicit NuBrowse editorial guides. Refresh: package metadata is refreshed from NuGet when the page loads. Limit: this is not a security, legal or compatibility guarantee; validate the selected version in your project.
Useful next steps
Move from package metadata to a concrete selection or review workflow.