1.0.0 • Published 8 years ago

knockout-init v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

knockout-init

Module for initializing knockout observables.

Usage

<div data-bind="init: { key: foo, value: 'bar' }"></div>
var foo = ko.observable(null);
foo.subscribe(function (val) {
  // val === "bar" --> true
});

Installation

This is how I use it with a Webpack bundled project. Your setup may be different.

$ npm install knockout-init --save-dev
import ko from "knockout";
import init from "knockout-init";

ko.bindingHandlers.init = init(ko);