How to 'decorate' an Angular Schema Form decorator?

598 views Asked by At

I've read how to extend Angular Schema Forms. It allows creating a decorator which can change the visual appearance of all form items.

What I want is to have the default visuals for all form fields, but add a "Reset to default" button added after each field.

Is there a way to 'decorate' the existing form fields with this functionality without overriding them all? What's the best way to achieve this?

1

There are 1 answers

0
Anthropic On

Using the new builder that is in the development branch you can actually attach functionality to all fields.

You would add a function to the default builder array and append to the root tag your own node with your button inside.

Then you could pass it the attributes it would need to provide the required functionality.

There should be a build with this code in master not too far away.