CounterController

A CounterController tracks a single value and provides methods for incrementing, decrementing, and setting that value.

OptionTypeDefaultValueDescription
initialnumber0Optional - The controller's initial value.
PropertyTypeDescription
valuenumberThe controller's current value.
MethodDescription
increment()Increases the controller's value` by one.
incrementBy(num: number)Increases the controller's value by the value of num.
decrement()Decreases the controller's value by one.
decrementBy(num: number)Decreases the controller's value by the value of num.
reset()Resets the controller to its initial value.

Example: