Stay organized with collections Save and categorize content based on your preferences.

blockly > FieldAngle > (constructor)


Constructs a new instance of the FieldAngle class


constructor(opt_value?: string | number | Sentinel, opt_validator?: Function, opt_config?: FieldAngleConfig);


Parameter Type Description
opt_value string | number | Sentinel (Optional) The initial value of the field. Should cast to a number. Defaults to 0. Also accepts Field.SKIP_SETUP if you wish to skip setup (only used by subclasses that want to handle configuration and setting the field value after their own constructors have run).
opt_validator Function (Optional) A function that is called to validate changes to the field's value. Takes in a number & returns a validated number, or null to abort the change.
opt_config FieldAngleConfig (Optional) A map of options used to configure the field. See the [field creation documentation] for a list of properties this parameter supports.