2

I am trying to improve the performance of my ng-repeat's. I have upgraded my project to use library v1.3.0 (main lib and route).

I am trying to use the bind once as here: Do bindings nested inside of a lazy one-time ng-repeat binding bind just once?

However, when i add :: to my ng-repeat, the list is not populated:

<li ng-repeat="info in Profile.ChangeInfo">                 
    <p> {[{info.Message}]} </p>
</li>

The above works.

The below fails:

<li ng-repeat="info in ::Profile.ChangeInfo">                   
    <p> {[{::info.Message}]} </p>
</li>

Error i see is:

Error: [$parse:syntax] http://errors.angularjs.org/1.3.0-beta.9/$parse/syntax?p0=%3A&p1=not%20a%20primary%20expression&p2=1&p3=%3A%3AProfile.ChangeInfo&p4=%3A%3AProfile.ChangeInfo

UPDATE Upgraded to beta 16, and now seeing this error in IE8:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; MS-RTC LM 8; InfoPath.3) Timestamp: Fri, 15 Aug 2014 12:01:03 UTC

Message: [$injector:modulerr] Failed to instantiate module ng due to:
Object doesn't support this property or method
http://errors.angularjs.org/1.3.0-beta.16/$injector/modulerr?p0=ng&p1=Object%20doesn't%20support%20this%20property%20or%20method
Line: 3982
Char: 7
Code: 0
URI: http://local host:1010/js/vendor/angular.js
Community
  • 1
  • 1
Oam Psy
  • 8,555
  • 32
  • 93
  • 157

2 Answers2

7

The bindonce syntax :: has been introduced since angularjs version 1.3.0-beta.16

You have to upgrade angularjs to version 1.3.0-beta.16 or newer.

runTarm
  • 11,537
  • 1
  • 37
  • 37
  • can now see the list, but IE8 no longer loads the page. – Oam Psy Aug 15 '14 at 12:04
  • AngularJS v1.3.x already dropped support for IE8, not sure if it's relate to your issue. Is there any error in the console? – runTarm Aug 15 '14 at 12:06
  • displaying the error in my Update post. Beta 8 is working fine in IE8 – Oam Psy Aug 15 '14 at 12:09
  • @OamPsy If you really need to support IE8, it might be better to stick with angularjs `1.2.x`. And if you would like to use the bindonce feature, you could use something like this 3rd party module https://github.com/Pasvaz/bindonce – runTarm Aug 15 '14 at 18:20
2

please see here sample demo http://jsbin.com/wimon/2/edit

Use the latest angularjs beta

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.18/angular.min.js"></script>

Remove square bracket

<li ng-repeat="info in ::Profile.ChangeInfo">                   
    <p> {{::info.Message}} </p>
</li>
sylwester
  • 16,498
  • 1
  • 25
  • 33