Class: SwitchComponent

SwitchComponent(dataObjectopt, optionsopt)

SwitchComponent gives the user the ability to flip a switch. The switch may be on/off or momentary with push-to-break or push-to-make options.

Constructor

new SwitchComponent(dataObjectopt, optionsopt)

Parameters:
Name Type Attributes Default Description
dataObject DataObject <optional>
null
options Object <optional>
null
Properties
Name Type Attributes Default Description
dataField string <optional>
null a field in dataObject that this switch should reflect and control
Source:
To Do:
  • Add a Bink event on switch change (DataModel 'changed:fieldName' events work, of course)
Example

Allow the user to change a boolean data field

const switchComponent = new SwitchComponent(myDataModel, {
	dataField: 'activated'
})