# How to bind html with ionic tags

**URL:** <https://forum.ionicframework.com/t/how-to-bind-html-with-ionic-tags/108214>\
**Category:** ionic-v3\
**Created:** [October 9, 2017, 4:51pm UTC](https://forum.ionicframework.com/t/how-to-bind-html-with-ionic-tags/108214 "2017-10-09T16:51:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![avishai\_peretz\_dev](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@avishai\_peretz\_dev](https://forum.ionicframework.com/u/avishai_peretz_dev)\
**Post date:** [October 9, 2017, 4:51pm UTC](https://forum.ionicframework.com/t/how-to-bind-html-with-ionic-tags/108214/1 "2017-10-09T16:51:42Z")

</div>

I want to render html to my template by passing variable (templateHtml) but is not render the html only text.  
Any solution?

my template

```auto
<ion-content padding >
  <div [innerHtml]="templateHtml"></div>
</ion-content>

```

my component

```auto
import {Component} from '@angular/core';
import { NavController } from 'ionic-angular';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
  templateHtml: any = `<button ion-button (click) = "testClick()">Test</button>`;

  constructor(public navCtrl: NavController) {
    
  }

  testClick() {
    console.log('click');
  }
}

```

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [October 9, 2017, 6:18pm UTC](https://forum.ionicframework.com/t/how-to-bind-html-with-ionic-tags/108214/2 "2017-10-09T18:18:33Z")

</div>

If you don’t get any better answers, I would suggest pretending `innerHTML` doesn’t exist. It encourages unidiomatic code that is hard to read, maintain, and test, and doesn’t do what people expect it to, as you have discovered.
