문제

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