2

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 ?

1 Answer 1

3

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:

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.