- If you're using ngx-formly, or looking for a more flexible, modern, and extensible form solution, then piying-view might be the next-generation choice worth trying.
π Background
-
ngx-formlyis an excellent form abstraction library. - However, as project complexity increases, I found limitations in certain areas. Therefore, inspired by the core philosophy of ngx-formly, I've made several improvements and added more features, resulting in the creation of piying-view.
π Improvements
Reset
-
ngx-formlyonly supports global reset. To reset individual form controls, you need complex custom implementations. -
piying-viewallows any form control to be reset simply by calling itsresetmethod, including all its child controls (if any).
Input Properties
-
ngx-formlyonly supports setting properties via customprops, and does not support Angularβs built-in input properties. -
piying-viewsupports bothpropsand native Angular input properties (@Input), meaning existing components can be used directly as form controls.
Form Binding
-
ngx-formlyrequires inheritance fromFieldType, making it incompatible with direct use of custom form controls. -
piying-viewallows existing custom form controls to be used directly without modification.
Component References
-
ngx-formlyonly supports synchronous component loading. -
piying-viewsupports both synchronous and asynchronous component loading.
Query
-
ngx-formlyonly supports querying child controls, not direct parent or root-level queries. -
piying-viewsupports querying children, parents (..), root (#), and named controls (@xxx) via path query.
Validators
-
ngx-formlyoffers limited built-in validators, but supports custom validators. -
piying-viewsupports all validators fromvalibot, includes i18n support, and also allows custom validators.
Layout
-
ngx-formlyuses the defined position as layout. -
piying-viewfixes the position during definition, but allows dynamic layout adjustments using layout actions.
Input Listening
-
ngx-formlyrequires dynamic property updates to be implemented inngOnInit. -
piying-viewacceptsSignal,Observable, orPromiseas input parameters, enabling real-time updates.
Group Disabling
-
ngx-formlydisables all controls within a group if any control in the same group is disabled. -
piying-viewallows disabling only specific logical groups within a single group.
π₯ New Features
π― Directive Support
- Supports applying Angular directives directly to components.
π§© Selectorless Mode
- Supports selectorless components β created components do not require a
selectordefinition in the template.
π€ Strong Typing
- Definitions can be directly converted into TypeScript types, enhancing development experience and type safety.
π οΈ Custom Actions
- Allows encapsulating functionality into reusable Actions.
π Multi-Platform Support
- Supports not only
Angular, but also provides adapter layers forVue,React,Svelte, andSolid, ideal for cross-framework projects or future migration.
π Bidirectional Data Transformation
- Supports
pre-processing(e.g., formatting) of input data andpost-processing(e.g., serialization) of output data β meeting complex business requirements. Learn more
π Feature Comparison
- π - Fully supported π€’ - Partially supported π₯΅ - Not supported
| Feature | piying-view | ngx-formly |
|---|---|---|
| Wrapper | π | π |
| Control Group | π | π |
| Controls | π | π |
| JSON Schema | π | π |
| Validators | π | π |
| Component Layout | π | π |
| Settings Class | π | π |
| Plugins | π | π |
| Form Reset | π | π€’ |
| Form Query | π | π€’ |
| Input Properties | π | π€’ |
| Data Transformation | π | π€’ |
| Async Components | π | π₯΅ |
| Group Disabling | π | π₯΅ |
| Decorators | π | π₯΅ |
| Selectorless | π | π₯΅ |
| Multi-Platform | π | π₯΅ |
| Strong Typing | π | π₯΅ |
| Pre-built Component Library | π₯΅ | π |
π Final Thoughts
- Get Started Quickly
- If you're interested in piying-view, feel free to visit the π Official Website for more documentation and examples.
- Have feedback or suggestions? We welcome your π© contributions.
- π¦ Source Code
Top comments (0)