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>
Now you can do it throw this extension:
translate-once
translate-once directive makes use of the link function and the asynchronous resolver of $translate(). The directive’s link function takes the translation key, looks it up asynchronously with $translate(), and once resolved, writes it to the element.