Skip to content
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

Render HTML from schema property description #405

Open
Jelledb opened this issue Aug 6, 2021 · 1 comment
Open

Render HTML from schema property description #405

Jelledb opened this issue Aug 6, 2021 · 1 comment

Comments

@Jelledb
Copy link

Jelledb commented Aug 6, 2021

Hey 👋

We're using ngx-schema-form to enable our customers to build their own forms, and it's working great so far.

One idea that we had, which would be awesome, is to enable custom HTML insertion via the JSON Schema description. This way you could do custom styling, provide hyperlinks, etc.

Our case would be to create JSON schema properties that contains links to support boards, e.g.

"paymentId": {
  "type": "string",
  "title": "Payment ID",
  "description": "Enter a valid payment ID. If you're not sure what to enter, please go to our <a href=\"https://docs.acmecorp.com/payment-id-help\">support page</a>"
}

Hint: it should be quite easy to do with Angular's [innerHtml] directive, which also makes sure there's no XSS magic going on.

@daniele-pecora
Copy link
Collaborator

Consider creating a custom UI Widget Library.
ngx-schema-form has support to use a complete customized UI Widget Library.
Here is an example using the Angular Material components:
DEMO: https://ngx-schema-form-material.web.app/
Try it yourself at Stackblitz: https://stackblitz.com/edit/angular-9-ngx-schema-form-material-template-9

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

No branches or pull requests

2 participants