Creating a dataList programmatically

ⅰ亾dé卋堺 提交于 2019-12-05 19:02:55
Günter Zöchbauer

As far as I know it is not possibly to make dynamically built markup containing mustaches bind to fields.

Polymer 0.15.0 adds injectBoundHtml. The used expressions must already be used somewhere so Smoke knows to generate code for them. See https://groups.google.com/a/dartlang.org/d/msg/web/uqri0fpGH10/dPm169WUiUwJ for more details.

Just put the HTML into the template of your Polymer element.
I can't see a reason in your example why you would need to create the HTML dynamically.

If you absolutely want to add the HTML dynamically you could also iterate over your list and include the values you want to bind directly into the generated HTML.

If you must build your HTML dynamically you can use Node.bind() to create bindings dynamically.

Here is an example that uses Node.bind() Dart: Dynamic usage of polymer-ui-tabs and polymer-ui-pages does not work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!