adding raw template to decorator#809
adding raw template to decorator#809Traksewt wants to merge 2 commits intojson-schema-form:developmentfrom
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. |
Anthropic
left a comment
There was a problem hiding this comment.
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