web-widgets-knockout

0.1.1 • Public • Published

web-widgets-knockout

Use generic JavaScript widgets in Knockout, and create generic widgets using Knockout.

Example

var shoutingWidget = function(element, options) {
    element.innerHTML = options.name.toUpperCase();
};

var widget = widgetsKnockout.create({
    template: 'Hello <span data-bind="widget: \'shout\', widgetOptions: {name: name}"></span>',
    init: function(options) {
        return {name: options.name};
    },
    dependencies: {
        shout: shoutingWidget
    }
});

widget(element, {name: "Bob"});
// element.innerHTML == 'Hello <span data-bind="widget: \'shout\', widgetOptions: {name: name}">BOB</span>'

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i web-widgets-knockout

Weekly Downloads

0

Version

0.1.1

License

none

Last publish

Collaborators

  • mwilliamson