CngxStepperPrevious
projects/common/stepper/controls/stepper-previous.directive.ts
Import#
import { CngxStepperPrevious } from '@cngx/common/stepper'
Description#
Turns any clickable element into a stepper "Back" control. Resolves
its host the same way CngxStepperCount does - an explicit [host]
input (for placement outside the stepper tree) falling back to the
ambient CNGX_STEPPER_HOST.
(click) retreats via selectPrevious(). The control disables itself
when there is no earlier step (!canGoPrevious()) OR while a commit is
in flight (busy()): selectPrevious() writes activeStepIndex
directly, bypassing the commit controller, so disabling it during an
in-flight forward commit prevents a navigate-mid-commit race. The gate
is the host's canGoPrevious bound - never re-derived from stepsOnly.
Reflects the disabled state via aria-disabled only - never native
disabled - so the control stays focusable and AT-reachable; the
handleClick guard blocks the action while disabled.
<button cngxStepperPrevious>Back</button>Metadata#
Host#
Index#
Inputs#
Explicit stepper-host reference for placement outside the stepper
tree ([host]="s.presenter"). When unset, the ambient
CNGX_STEPPER_HOST is injected.
nullHostBindings#
| Binding | Expression |
|---|---|
[attr.aria-disabled] | disabled() || null |
HostListeners#
| Event | Handler |
|---|---|
(click) | click() |