render text as html while iterating in polymer table

Issue

how to render text as html

<polymer-element name = "table-element" attributes ="structure data">
     <template>
         <table class="ui table segment" id="table_element">
             <tr>
                 <th template repeat="{{col in cols}}">
                     {{col}}
                 </th>
             </tr>
             <tr template repeat="{{row in data}}">
                **<td template repeat="{{field in fields}}">
                   {{row[field]}} // render this as html
                 </td>**
             </tr>
         </table>
     </template>
<script type="application/dart" src="table_element.dart"></script>
</polymer-element>

below text

"<a href=\"http://google.com\"> open</a>"

is rendered as plain text <a href="http://google.com"> open</a> inside table ,how to make this rendered as html ?

Solution

Update

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


You can use something like a <safe-html> element shown here:

Answered By – Günter Zöchbauer

Answer Checked By – Pedro (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.