标签: angularjs-ng-pluralize

AngularJS使用angular-translate和ng-pluralize进行复数化

我有这段代码

<ng-pluralize count="comment.Comment.like_count"
    when="{'0': {{'LIKES_LIKE' | translate}},
        'one': {{'LIKES_LIKE' | translate}},
    'other': '{{'LIKES_LIKES' | translate}}}">
</ng-pluralize>
Run Code Online (Sandbox Code Playgroud)

但我无法弄清楚如何格式化字符串,以便它实际解析翻译过滤器喜欢的字符串,以便ng-pluralize指令接收解析的语言字符串.

错误消息是这样的:

错误:[$ parse:lexerr] Lexer错误:第107-123列['|]的未终止引用 翻译}}}]在表达式[{'0':{{'LIKES_LIKE'| 翻译}},'one':{{'LIKES_LIKE'| 翻译}},'其他':'{{'LIKES_LIKE'| 翻译}}}].

我很清楚我的意思,但我无法弄清楚如何让它发挥作用.有任何想法吗?

internationalization angularjs angularjs-ng-pluralize

5
推荐指数
2
解决办法
3555
查看次数