punj punj - 1 month ago 8
AngularJS Question

How to keep html_safe inside angular variable string?

{{member.content.length < 300 ? '' : "<a href='javascript:void(0)' onclick='show()'>..Read More>></a>"}}</p>


output should be like:
..Read More>>

Answer Source

Is this what you are trying to achieve?

<a ng-if="member.content.length < 300"
   href="javascript:void(0)"
   onclick="show()">
   ..Read More>>
</a>

You can use the ng-if directive to hide or show in AngularJS. Angular 2 uses *ngIf="member.content.length < 300" directive.