1

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.

Isvara
  • 3,403
  • 1
  • 28
  • 42

1 Answers1

2

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>

Community
  • 1
  • 1
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
  • You may take a look at my answer to this question http://stackoverflow.com/questions/20406328 if you need access to the parent to make the element replace itself. – Günter Zöchbauer Mar 12 '14 at 07:31