How can I use HTML tags inside ng-pluralize?

609 views
Skip to first unread message

Martin

unread,
Jul 4, 2013, 4:51:10 PM7/4/13
to ang...@googlegroups.com
Trying to bold the numbers in my ng-pluralize directive. But the html tags show up as straight text:

<ng-pluralize count="member.tickets"
when="{'0': '0 Free Menu Tickets',
'one': '<strong>1</strong> Free Menu Ticket',
'other': '{} Free Menu Tickets'}">
</ng-pluralize>

This is what I get:
<strong>1</strong> Free Menu Ticket

Is there a way I can tell angular to accept my strong tag?
Is this not possible?

Qiusheng Jiang

unread,
Nov 15, 2013, 1:43:44 PM11/15/13
to ang...@googlegroups.com
I am facing the same issue and also need to show html content when using ng-pluralize.

Please give an example, thanks!

OpenNota

unread,
Nov 17, 2013, 9:38:47 AM11/17/13
to ang...@googlegroups.com
I'm afraid you need to write your own directive.

Alexandre Vasconcelos

unread,
Nov 18, 2013, 5:56:11 AM11/18/13
to ang...@googlegroups.com
hi Martin,

try use $sce injector, and try something like that,

$sce.trustAsHtml(yourHTML, $sce.HTML)
Reply all
Reply to author
Forward
0 new messages