One-time binding with filter

Abraham picture Abraham · Sep 18, 2014 · Viewed 7.9k times · Source

I'll migrate my angularjs application from 1.2.0 to 1.3.0-rc2 and I want to change my code from bindonce to the new one-time binding.IS also used angular-translation. I write the follow code:

<span data-ng-bind="::'COMMENT'|translate" />
<span>{{::'COMMENT'|translate}}</span>
 <img src="shareBlack.png" alt="{{::'SHARE'|translate}}" data-ng-attr-title="::'SHARE'|translate" data-ng-click="startShare()" />

But in Batarang I can see the follow watch expressions:

{{::'SHARE'|translate}} | 3.59% | 17.00ms
::'COMMENT'|translate | 2.95% | 14.00ms

What I did wrong?

EDIT in the previous version 1.2.0 with bindonce I have the following code:

<div class="box-container" bindonce>
    ...
       <span data-bo-text="'FEED_ALLOWED_COMMENTS'|translate"/>
    ...
</div>

Answer

vgrafe picture vgrafe · Feb 18, 2015

Just came across this question and the following possible answer while confronted to the same issue:

try :

{{::('COMMENT'|translate)}}

http://plnkr.co/edit/QogrC0bOvX8EYnmQOhpf?p=preview