-
Notifications
You must be signed in to change notification settings - Fork 652
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
adding raw template to decorator #809
base: development
Are you sure you want to change the base?
Conversation
@Traksewt thanks for your PR sorry for the delayed response, I was in the middle of the separated core changes and then holidays, would you be able to update to the latest version and reapply your changes to the renamed files? Would love to accept your efforts :) src/services/builder.js -> src/services/sf-builder.provider.js |
316f53e
to
daecafe
Compare
@Anthropic ok no problem. rebased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change from form to field breaks three tests, can you add the field.type test below the form.type test, I would expect that to work for both cases.
Didn't realise I could change it myself within your commit, how cool :) Oh but then your test fails... hmmm... |
@Traksewt any ideas? |
The tests are failing because the decorator is trying to load the template remotely as a url, but the template is a string. |
Description
Currently setting the template for a custom decorator requires using the template cache, and you cannot pass in a raw template string. There is some code inside the decorator provider to support it, but it is not exposed, as it does not work.
When manually setting the decorator to have type equals to template, the builder cannot find the raw template. This is because it is looking for the 'template' field on the wrong variable, checking the form instead of the 'field'.
To test out using a raw template, you can try
Fixes Related issues
Checklist
@json-schema-form/angular-schema-form-lead