V. P. Verma V. P. Verma - 7 months ago 29
HTML Question

Why ng-bind-html shows only text without link?

I am using

ng-repeat
to display a list. In my data there is a field which contains Url that I need to be displayed as a link in my html page. Please see below screen shots:

My Html:

enter image description here

My rendered page:

enter image description here

I have added
angular-sanitize.js
script in my page and added dependency for '
ngSanitize
' in my main module. But I can't find why the
ng-bind-html
only showing text without link? Helps are much appreciated.

Suggestion 1 Outcome:

enter image description here

and updated code:

enter image description here

GG. GG.
Answer

You have to use a hyperlink (<a>)

<a href="{{ sc.url }}" ng-bind="sc.Url"></a>
Comments