# Ng-bind-html cut html text?

**URL:** <https://discourse.nodered.org/t/ng-bind-html-cut-html-text/34248>\
**Category:** General\
**Created:** [14 October 2020 14:41 UTC](https://discourse.nodered.org/t/ng-bind-html-cut-html-text/34248 "2020-10-14T14:41:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![conan](https://avatars.discourse-cdn.com/v4/letter/c/13edae/32.png) [@conan](https://discourse.nodered.org/u/conan)\
**Post date:** [14 October 2020 14:41 UTC](https://discourse.nodered.org/t/ng-bind-html-cut-html-text/34248/1 "2020-10-14T14:41:36Z")

</div>

Hello,  
I have a function node that produce a msg.payload like this:

```auto
<div class="ctimer_block_empty"></div>
<div id="00:00" class="ctimer_block_free" onClick="func1('00:00')"></div>
<div id="00:30" class="ctimer_block_free" onClick="func1('00:30')"></div>
<div class="ctimer_block_empty"></div>

```

then I pass the msg.payload in input to a template node:

```auto
<div class="container_timer" ng-bind-html="msg.payload"></div> to render the html.

```

But in the browser I can't click the div and if I parse the page id and onClick are gone!  
I trace the msg.payload and is complete, I also use ng-bind and I can see all my html code.  
Why ng-bind-html cut my html text?  
What am I doing wrong?

Thanks in advance for anyone who can help me.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 October 2020 15:12 UTC](https://discourse.nodered.org/t/ng-bind-html-cut-html-text/34248/2 "2020-10-14T15:12:44Z")

</div>

By default Angular strips out anything not-trusted - so any script tags etc.

You can add a filter to allow everything eg

```auto
<div ng-bind-html="msg.payload | trusted"></div>

```

---

<div class="post-metadata">

**Author:** ![conan](https://avatars.discourse-cdn.com/v4/letter/c/13edae/32.png) [@conan](https://discourse.nodered.org/u/conan)\
**Post date:** [14 October 2020 16:21 UTC](https://discourse.nodered.org/t/ng-bind-html-cut-html-text/34248/3 "2020-10-14T16:21:18Z")

</div>

> [@dceejay](#):
>
> `<div ng-bind-html="msg.payload | trusted"></div>`

WOOOW!!! 😀 😀 😀 ✌ ✌ ✌

I solved  
Thank you very much!!!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [28 October 2020 16:21 UTC](https://discourse.nodered.org/t/ng-bind-html-cut-html-text/34248/4 "2020-10-28T16:21:19Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
