blockly > FieldAngle > (constructor)


Constructs a new instance of the FieldAngle class


constructor(value?: string | number | typeof Field.SKIP_SETUP, validator?: FieldAngleValidator, config?: FieldAngleConfig);


Parameter Type Description
value string | number | typeof Field.SKIP_SETUP (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).
validator FieldAngleValidator (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.
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.