-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): support custom model json map fn injectionToken #1009
base: master
Are you sure you want to change the base?
feat(core): support custom model json map fn injectionToken #1009
Conversation
The map func is of type DynamicFormControlModelConfigMapFn which passes an instance of the service with the model. this is done in order to support recursive calling 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 json config. this allowes to map 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.
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
@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? |
Has this been resolved @udos86 ? |
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 #762