ng-dynamic-forms icon indicating copy to clipboard operation
ng-dynamic-forms copied to clipboard

feat(core): support custom model json map fn injectionToken

Open ronnetzer opened this issue 5 years ago • 8 comments

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

ronnetzer avatar Aug 17 '19 16:08 ronnetzer

Codecov Report

Merging #1009 into development will decrease coverage by 0.14%. The diff coverage is 60%.

Impacted file tree graph

@@               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.

codecov-io avatar Aug 17 '19 17:08 codecov-io

@ronnetzer Thank you very much for this PR!

Please give a bit of time to review this. Thanks again

udos86 avatar Aug 19 '19 10:08 udos86

@udos86 any news? would love to see this PR merged :)

ronnetzer avatar Sep 23 '19 13:09 ronnetzer

@udos86 Can this be merged? It would be a very useful functionality :)

Zelgadis87 avatar Nov 02 '19 22:11 Zelgadis87

@udos86 Can you please review and merge this for the next version!!??

SoulOnFire avatar Jan 23 '20 11:01 SoulOnFire

@udos86 any update on this?

MalTarDesigns avatar Jan 18 '21 15:01 MalTarDesigns

@udos86 any updates on this PR?

wdunn001 avatar Jan 18 '21 15:01 wdunn001

@ronnetzer Thank you very much for this PR!

Please give a bit of time to review this. Thanks again

Has this been resolved @udos86 ?

Neolin-Pachai avatar Jul 25 '22 11:07 Neolin-Pachai