Adam Silva Adam Silva - 1 year ago 80
AngularJS Question

Convert HTML from DB

I'm using TextAngular to save some posts to the database(with data type being

). It stores in the database like:
<h1>This is a header</h1>
. But when I go to retrieve from the database and display it in the HTML, it displays like
<h1>This is a header</h1>

Any idea how I can convert it either in the PHP or Javascript so it appears with the corresponding styles?

P.S.: I'm using Laravel for back-end(retrieval of data) and AngularJS for front-end(displaying data).

Answer Source

You don't need to convert anything. Just use ng-bind-html.

Take a look to the documentation for more information :

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