javascript - How to keep html_safe inside AngularJS variable string? -


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

output should like: ..read more>>

is trying achieve?

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

you can use ng-if directive hide or show in angularjs. angular 2 uses *ngif="member.content.length > 300" directive.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -