【发布时间】:2016-02-07 03:11:51
【问题描述】:
您能否建议如何将{{$count}} times per month <span ng-include="'views/partials/month-dates.html'"></span> 分配给translate-plural 属性?
例如以下表达式导致解析错误:
<translate translate-n="notification.Data[flightType][direction].Days.length" translate-plural="{{$count}} times per month <span ng-include=\"'views/partials/month-dates.html'\"></span>">
N times per month on <span ng-include="'views/partials/month-dates.html'"></span>
</translate>
【问题讨论】:
-
试试
translate-plural="{{$count}} times per month <span ng-include=\"views/partials/month-dates.html\"" -
我已经解决了用 ng-include 指令中的变量替换常量的问题:
上每月 N 次 但是问题仍然存在:是否可以在角度指令中使用双引号?@Tamil Selvan 您的解决方案不仅会导致解析错误,而且还有语法错误:您没有在开头使用引号转义常量。试试translate-plural="{{$count}} times per month <span ng-include=\"'views/partials/month-dates.html'\""
标签: angularjs angularjs-directive quotes double-quotes