Module: ko/ui/button

ko/ui button element

This module inherits methods and properties from the module it extends.

Example

// Regular button
var button = require("ko/ui/button").create("Click Me!");
button.on("click", () => console.log("Hello!"));

// Menu Button
var button = require("ko/ui/button").create("I'm a menu button", { type: "menu-button" }); // type can also be "menu"
button.addMenuItem({ label: "Click me!", command: () => console.log("Hello!") });
Author:
  • NathanR, CareyH
License:
  • Mozilla Public License v. 2.0

Extends

Classes

Model()

Methods


require("ko/ui/button").create(label [, options])

Create a new button UI element

Parameters:
Name Type Argument Description
label string | object

The label value, if this is an object then it will be used as the options param

options object <optional>

An object containing attributes and options

Returns:
Type
module:ko/ui/button~Model