I'm trying to use a one-time binding in Angular. I have the following piece of HTML:
<img ng-src="{{::photo.src}}"/>
When the page loads, Angular throws this error:
Syntax Error: Token ':' not a primary expression at column 1 of the expression [::photo.src] starting at [::photo.src]
I read in a few different places that this was likely due to a leading space in the expression... but as you can see, there's no leading space in my code. If I do add the leading space, I of course get the same error (but at column 2).
I'm using version 1.3.10 of Angular, so I believe one-time binding is included.
Any help would be greatly appreciated!
Edit: it seems I was mistaken - I was actually using version 1.2.24, so one-time binding was not yet supported. Thanks to @sss for pointing this out.
One-time binding is supported since AngularJS 1.3.0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With