Saurabh Sharma
Saurabh Sharma

Reputation: 503

Hot to remove first and last double quotes in Angular 4?

Just like JavaScript, TypeScript also uses the double quote (") or single quote (') to surround string data. I'm returning some data from back end which contains some HTML.

My API response:  <p>afjhjhfsd</p>

and I print this on view in angular 4 like {{response}}. When I inspect in chrome browser it is showing like:

"<p>afjhjhfsd</p>"

Due to this reason it is also printing paragraph tag on angular 4 view. Please help me into this.

Upvotes: 0

Views: 983

Answers (1)

Matt
Matt

Reputation: 2298

try binding to innerHTML

<div [innerHTML]="response"></div>

Upvotes: 1

Related Questions