Skip to content
This repository has been archived by the owner on Apr 30, 2018. It is now read-only.

Make fieldTransform an array. #458

Closed
kentcdodds opened this issue Sep 9, 2015 · 2 comments
Closed

Make fieldTransform an array. #458

kentcdodds opened this issue Sep 9, 2015 · 2 comments

Comments

@kentcdodds
Copy link
Member

This would make it possible to have multiple fieldTransforms.

This could be implemented as a non-breaking change by making this capable of handling a function or an array of functions:

if (fieldTransform) {
$scope.fields = fieldTransform($scope.fields, $scope.model, $scope.options, $scope.form);
if (!$scope.fields) {
throw formlyUsability.getFormlyError('fieldTransform must return an array of fields');
}
}

We'd want to log a deprecation warning, add error/warning docs, and test that (like we've done before, implementation | warning docs | test).

Then in a breaking release we could remove that logic and require it to be an array.

This one's up for grabs (whether you've contributed to open source before or not!)

@BarryThePenguin
Copy link
Contributor

Looks interesting, happy to have a go

@kentcdodds
Copy link
Member Author

Awesome!

  • Kent C. Dodds

(Sent from my mobile device, please forgive typos or brevity)
On Sep 10, 2015 5:15 PM, "Jonathan Haines" notifications@github.com wrote:

Looks interesting, happy to have a go


Reply to this email directly or view it on GitHub
#458 (comment)
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants