# Angular Html Template

**URL:** https://community.siren.io/t/angular-html-template/448
**Category:** Siren Platform/Investigate Tech Support Community
**Created:** [February 4, 2022, 4:00pm UTC](https://community.siren.io/t/angular-html-template/448 "2022-02-04T16:00:56Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bogolese](https://avatars.discourse-cdn.com/v4/letter/b/f05b48/32.png) [@bogolese](https://community.siren.io/u/bogolese)
#### Post date: [February 4, 2022, 4:00pm UTC](https://community.siren.io/t/angular-html-template/448/1 "2022-02-04T16:00:56Z")

</div>

Hello,

I have created an Angular HTML template to display, among other things, html that is stored in a field. The template displays the field . . . as markup. In other words, it doesn’t parse it as html.

Is there a way to tell ng-bind-html to _render_ the html?

I am using:

ng-bind-html=“indexPattern.formatField(hit, ‘markup’) | trustAsHtml”

Thank you! 🙂

---

<div class="post-metadata">

### Author: ![bogolese](https://avatars.discourse-cdn.com/v4/letter/b/f05b48/32.png) [@bogolese](https://community.siren.io/u/bogolese)
#### Post date: [February 4, 2022, 4:05pm UTC](https://community.siren.io/t/angular-html-template/448/2 "2022-02-04T16:05:00Z")

</div>

FYI:

Investigate Version: 11.1.4  
Federate Version: 7.6.2-20.2 on ES 7.6.2

---

<div class="post-metadata">

### Author: ![bogolese](https://avatars.discourse-cdn.com/v4/letter/b/f05b48/32.png) [@bogolese](https://community.siren.io/u/bogolese)
#### Post date: [February 4, 2022, 5:29pm UTC](https://community.siren.io/t/angular-html-template/448/3 "2022-02-04T17:29:05Z")

</div>

Okay, after futzing with the template a bit more, it appears that the “offender” is the (Siren?) indexPattern.formatField(…) call. For instance, if I change a “simple” field from:

ng-bind-html=“indexPattern.formatField(hit, ‘title’) | trustAsHtml”

to

ng-bind=“indexPattern.formatField(hit, ‘title’)”

I see the tags that surround the value of “title” are not parsed as html (i.e., it dumps the markup to the page).

So I need to get Siren or Angular or BOTH to simply _dump_ the contents of my “markup” field to the page so that it is parsed as html.

I dearly hope I am making sense here. 🙂

Is there _any_ documentation on the API that indexField supports?

---

<div class="post-metadata">

### Author: ![Manu\_Agarwal](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.siren.io/manu_agarwal/32/120_2.png) [@Manu\_Agarwal](https://community.siren.io/u/Manu_Agarwal)
#### Post date: [February 7, 2022, 10:47am UTC](https://community.siren.io/t/angular-html-template/448/4 "2022-02-07T10:47:15Z")

</div>

Hi Richard,

You can display the html formatted value from the field into your template using this code:

`ng-bind-html="hit._source.html_field | trustAsHtml"`

Here is the template:

```auto
<div style="word-wrap: break-word;">
  <div ng-repeat="hit in hits|limitTo:limit track by hit._index+hit._type+hit._id+hit._score" class="snippet"
    style="border:1px #ddd solid; margin: 4px; padding: 4px">
    
    <div ng-bind-html="hit._source.html_field | trustAsHtml" ></div>
  
  </div>
</div>

```

[Documentation](https://docs.siren.io/siren-platform-user-guide/12.0/siren-investigate/c_record-table-visualization.html) for html-angular template.

Regards  
Manu

---

<div class="post-metadata">

### Author: ![bogolese](https://avatars.discourse-cdn.com/v4/letter/b/f05b48/32.png) [@bogolese](https://community.siren.io/u/bogolese)
#### Post date: [February 7, 2022, 4:17pm UTC](https://community.siren.io/t/angular-html-template/448/5 "2022-02-07T16:17:19Z")

</div>

Thanks. That works. The example I used had

ng-bind-html=“indexPattern.formatField(hit, ‘html\_field’) | trustAsHtml”

which will not format as HTML.

Might want to put some more template examples up. 😉
