VictorLe VictorLe - 2 years ago 63
HTML Question

Html isn't recognizing the tags that Angularjs spitting out


$ = "<h1>John Doe</h1>"




<h1>John Doe</h1>

How do I make it so Html recognize the tags that I'm spitting on the page.

Answer Source

The correct way would be:

$ = 'John Doe';



I don't know why would you set html tags in your variables if you really really don't need to.

EDIT according to comment:

In the case you need to use html tags in your templates, please see this answer on SO: AngularJS : Insert HTML into view

I'm not going to duplicate the answer because it's explained very well in that answer.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download