This content is for the 19.0.0 version. Switch to thelatest versionfor up-to-date documentation.
The Angular WML Toggle library offers a customizable toggle switch component for Angular applications. This library provides an easy-to-integrate toggle switch that enhances user interfaces by allowing binary choices such as settings or preferences. The core component, WMLToggleZeroComponent
, is designed to be flexible and modular, enabling developers to tailor its appearance and behavior to fit their application’s requirements. Features include:
Customizable Appearance: Modify the toggle’s background colors, text, and styles.Event Handling: Define actions on toggle state changes.Integration with Forms: Supports reactive forms and updates based on form control status.Responsive Design: Adapts to different screen sizes for a consistent user experience.
To install the WML Toggle library, use the following command:
Terminal window
npm install -s --verbose @windmillcode/angular-wml-toggle
Here are some possible examples of how to use the WMLToggleZeroComponent
in your Angular application:
you can sure to use onToggle to “listen for changes” how neat<iframe src="https://stackblitz.com/edit/stackblitz-starters-cmgmdk?ctl=1&embed=1&file=src%2Fmain.ts&theme=dark" style="width: 100%; height: calc(500/16 * 1em) !important;"></iframe>
<iframe src="https://stackblitz.com/edit/stackblitz-starters-khfnfw?ctl=1&embed=1&file=src%2Fmain.ts&theme=dark" style="width: 100%; height: calc(500/16 * 1em) !important;"></iframe> <iframe src="https://stackblitz.com/edit/stackblitz-starters-fk265u?ctl=1&embed=1&file=src%2Fmain.ts&theme=dark" style="width: 100%; height: calc(500/16 * 1em) !important;"></iframe>Property | Type | Description |
---|---|---|
id | string | Identifier for the toggle instance. |
container | WMLUIProperty | Configuration for the toggle container. |
thumb | WMLUIProperty | Configuration for the toggle thumb. |
toggleText | WMLUIProperty | Configuration for the toggle text. |
textToggleLeftMargin | number | Left margin for the toggle text. |
toggleBackgroundOnColor | string | Background color when the toggle is “On”. |
toggleBackgroundOffColor | string | Background color when the toggle is “Off”. |
triggerToggle | Function | Function to programmatically trigger the toggle. |
wmlField | WMLFieldZeroProps | Integration with WML Field component. |
onToggle | (self: WMLToggleZeroProps) => void | Callback function triggered on toggle state change. |
component created and ready for production use
added triggerToggle ,
updated package to reflect the version ^17.0.4 of @angular/core package,
updated package to reflect the version ^17.0.5 of @angular/core package,
updated package to reflect the version ^17.0.6 of @angular/core package,
updated package to reflect the version ^17.0.7 of @angular/core package
added support to be integrated with wml-form so that values can be passed to a form control
fixed code to remove deprecated scss warnings
added listened so when form is edited via patchValue the changes apply
added in disabled featured and corrected error when listenForFormValue changes was triggered till infinity ,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to reflect the version ^17.0.8 of @angular/core package,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to reflect the version ^17.1.0 of @angular/core package,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to reflect the version ^17.1.2 of @angular/core package,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to reflect the version ^17.1.3 of @angular/core package,
updated package to reflect the version ^17.2.1 of @angular/core package,
updated package to reflect the version ^17.2.2 of @angular/core package,
updated package to reflect the version ^17.2.3 of @angular/core package,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to reflect the version ^17.2.4 of @angular/core package,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to reflect the version ^17.3.0 of @angular/core package ,
updated package to reflect the version ^17.3.1 of @angular/core package,
updated package to reflect the version ^17.3.2 of @angular/core package,
updated package to reflect the version ^17.3.3 of @angular/core package,
updated package to reflect the version ^17.3.4 of @angular/core package,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to reflect the version ^17.3.5 of @angular/core package,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to reflect the version ^17.3.6 of @angular/core package,
updated package to reflect the version ^17.3.7 of @angular/core package,
updated package to reflect the version ^17.3.8 of @angular/core package,
updated package to reflect the version ^17.3.9 of @angular/core package,
updated package to reflect the version ^18.0.0 of @angular/core package,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to reflect the version ^18.0.1 of @angular/core package,
updated package to reflect the version ^18.0.2 of @angular/core package
[FIX]
In wml-toggle-zero.component.html, modified the click event to call toggle with parameters null and true.
Added distinctUntilChanged to listenForformControlChanges in wml-toggle-zero.component.ts to prevent redundant updates. In wml-toggle-zero.component.ts, adjusted toggle method to conditionally patch form control based on the new updateFormControl parameter. ,
updated package to reflect the version ^18.0.3 of @angular/core package,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to reflect the version ^18.0.5 of @angular/core package,
updated package to reflect the version ^18.0.6 of @angular/core package,
updated package to reflect the version ^18.1.0 of @angular/core package,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to reflect the version ^18.1.1 of @angular/core package,
updated package to reflect the version ^18.1.2 of @angular/core package,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to conform with @windmillcode/angular-wml-components-base ,
updated package to conform with @windmillcode/angular-wml-components-base
updated package to conform with @windmillcode/angular-wml-components-base
updated package to conform with @windmillcode/angular-wml-components-base
updated package to conform with @windmillcode/angular-wml-components-base
updated package to conform with @windmillcode/angular-wml-components-base
updated package to conform with @windmillcode/angular-wml-components-base
updated package to conform with @windmillcode/angular-wml-components-base
updated package to conform with @windmillcode/angular-wml-components-base
updated package to conform with @windmillcode/angular-wml-components-base
updated package to conform with @windmillcode/angular-wml-components-base
updated package to conform with @windmillcode/angular-wml-components-base
updated package to reflect the version 18.2.1 of @angular/core package
updated package to reflect the version 18.2.2 of @angular/core package
updated package to conform with @windmillcode/angular-wml-components-base
updated package to conform with @windmillcode/angular-wml-components-base
updated package to conform with @windmillcode/angular-wml-components-base
updated package to reflect the version 18.2.3 of @angular/core package
updated package to reflect the version 18.2.3 of @angular/core package
updated package to conform with @windmillcode/angular-wml-components-base
updated package to conform with @windmillcode/angular-wml-components-base
updated package to conform with @windmillcode/wml-components-base
updated package to reflect the version 18.2.4 of @angular/core package
updated package to conform with @windmillcode/wml-components-base
updated package to conform with @windmillcode/wml-components-base
updated package to reflect the version 18.2.5 of @angular/core package
updated package to reflect the version 18.2.6 of @angular/core package
updated package to reflect the version 18.2.7 of @angular/core package
updated package to conform with @windmillcode/wml-components-base
updated package to conform with @windmillcode/wml-components-base
updated package to conform with @windmillcode/wml-components-base
updated package to reflect the version 18.2.8 of @angular/core package
updated package to reflect the version 18.2.8 of @angular/core package
updated package to conform with @windmillcode/wml-components-base
updated package to conform with @windmillcode/wml-components-base
updated package to conform with @windmillcode/wml-components-base
updated package to conform with @windmillcode/wml-components-base
updated package to conform with @windmillcode/wml-components-base
updated package to conform with @windmillcode/wml-components-base
updated package to conform with @windmillcode/wml-components-base
updated package to conform with @windmillcode/wml-components-base
updated package to conform with @windmillcode/wml-components-base
updated package to conform with @windmillcode/wml-components-base