Вопрос

Given a List<Element> elements, is it possible to render the elements in the template, like this?

<template repeat="{{element in elements}}">
    {{element.SOMETHING}}
</template>

I'd want it to observe the list too, so that it would add and remove elements as the list changes.

Это было полезно?

Решение

Update

A ready-to-use element for Dart Polymer 1.0 is bwu-bind-html


{{}} can't include HTML.

You can use something like the <safe-html> tag (see answer to HTML Tags Within Internationalized Strings In Polymer.dart)

<template repeat="{{element in elements}}">
    <safe-html model="{{element.SOMETHING}}"></safe-html>
</template>

but I guess you have to change the <self-html> implementation so that it replaces itself with the content of model instead of adding model to it's content, because ul/ol can't contain <self-html>

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top