Pregunta

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 ?

¿Fue útil?

Solución

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:

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top