Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

One-time binding throwing error with {{::photo.src}}

Tags:

angularjs

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.

like image 634
Cody Avatar asked Oct 07 '14 19:10

Cody


1 Answers

One-time binding is supported since AngularJS 1.3.0.

like image 125
sylwester Avatar answered Oct 04 '22 22:10

sylwester