One-time metal error with {{:: photo.src}}

I am trying to use a one-time binding in Angular. I have the following HTML snippet:

<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 several different places that this is probably related to the leading space in the expression ... but as you can see, there is no leading place in my code. If I add the leading space, I of course get the same error (but in column 2).

I am using version 1.3.10 from Angular, so I believe that one-time binding is enabled.

Any help would be greatly appreciated!

Edit: it seems that I was wrong - in fact, I used version 1.2.24, so one-time binding was not yet supported. Thanks @sss for this.

+6
source share
1 answer

Bind-once is supported from angular v values. 1.3.0-beta.16 or 17

+7
source

Source: https://habr.com/ru/post/976375/


All Articles