将服务映射到 Appery.io HTML 组件和变量

发布于 2025-01-16 20:20:46 字数 334 浏览 0 评论 0原文

有没有办法获取连接到 Appery 数据库的服务并将其映射到 HTML 页面组件或变量?

我已成功设置连接到我的 Appery.io 数据库的服务,并将其映射到页面。

我可以将内容获取到文本和图像组件中,但将字符串映射到 HTML 组件似乎不起作用,将字符串映射到该页面上设置的变量(作为字符串键入)也不起作用。我也尝试将 $[i] 对象映射到 HTML 对象,但这似乎没有改变任何东西。

我尝试将几个不同的列映射到变量和 HTML 组件,甚至成功映射到其他组件的列也不会导致页面上显示任何内容。作为尝试查看发生情况的一种方法,我使用了“日志值到控制台”转换,但变量或 HTML 组件的控制台中没有显示任何内容。

Is there a way to take a service that connects to an Appery database and map it to an HTML page component or a variable?

I have successfully set up a service that connects to my Appery.io database and I'm mapping it to a page.

I can get content into Text and Image components, but mapping a string to the HTML component doesn't seem to work, nor does mapping a string to a variable set up on that page (typed as a string). I tried mapping the $[i] object to the HTML object as well, but that didn't seem to change anything.

I tried mapping a couple different columns to the variable and the HTML component and even the ones that successfully map to other components don't result in any content showing on the page. As a way of trying to see what was going on, I used the "log value to console" transformation and nothing shows up in the console for the variable or HTML component.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

哭泣的笑容 2025-01-23 20:20:46

基本映射无法用于此目的,因此请使用以下解决方法:

  1. 请添加两个自定义包含(SafeHtml 和 DomSanitizer)并基于它们定义变量:查看此处详细信息

  2. 在 HTML 组件上添加属性 [innerHtml]:

[innerHtml]=值

  1. 使用自定义代码将该值设置为该变量:
this.value = this.sanitizer.bypassSecurityTrustHtml('<a href="https://appery.io">appery.io</a>');

The basic mapping won't work for that purpose, so please use the following workaround:

  1. Please add two custom includes (SafeHtml and DomSanitizer) and define variables, based on them:see here details

  2. On the HTML component add the property [innerHtml]:

[innerHtml]=value

  1. Set the value to that variable with the custom code:
this.value = this.sanitizer.bypassSecurityTrustHtml('<a href="https://appery.io">appery.io</a>');
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文