ng-dynamic-forms
ng-dynamic-forms copied to clipboard
feat(core): support custom model json map fn injectionToken
The map func is of type DynamicFormControlModelConfigMapFn which passes the model along with an instance of the service. This is done in order to support recursive calling to fromJSON and other methods for cases like ARRAY.
The motivation behind this PR is to truly support custom controls. Currently, you can only extend known types and the extension is limited, you cannot really add new options to the model. This PR allows mapping model config JSON to a new model class with custom options and configurations.
My use case is a draggable form control which can be enabled from the JSON.
Also solves https://github.com/udos86/ng-dynamic-forms/issues/762
Codecov Report
Merging #1009 into development will decrease coverage by
0.14%
. The diff coverage is60%
.
@@ Coverage Diff @@
## development #1009 +/- ##
===============================================
- Coverage 91.62% 91.48% -0.15%
===============================================
Files 154 154
Lines 2293 2302 +9
Branches 236 238 +2
===============================================
+ Hits 2101 2106 +5
- Misses 135 137 +2
- Partials 57 59 +2
Impacted Files | Coverage Δ | |
---|---|---|
...forms/core/src/lib/service/dynamic-form.service.ts | 90.5% <60%> (-2.12%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update dfc275f...23ad525. Read the comment docs.
@ronnetzer Thank you very much for this PR!
Please give a bit of time to review this. Thanks again
@udos86 any news? would love to see this PR merged :)
@udos86 Can this be merged? It would be a very useful functionality :)
@udos86 Can you please review and merge this for the next version!!??
@udos86 any update on this?
@udos86 any updates on this PR?
@ronnetzer Thank you very much for this PR!
Please give a bit of time to review this. Thanks again
Has this been resolved @udos86 ?