-
Notifications
You must be signed in to change notification settings - Fork 27.5k
directive attribute evaluation in ng-repeat #1103
Comments
I'm using a linking function as a workaround. A regex loop looks for any unevaluated "{{ stuff }}" and uses $parent.$eval to evaluate and $digest. |
Having the same problem. Will look into the code. |
If you add item to the list on the fly, like via console, or on some action, ngRepeat will pass this item to directive without any problems. It means that at the time when linking is executed for the custom directive first time, scope doesn't contain needed value yet. Probably because custom directive is linked before ngRepeat. |
Peter Bacon Darwin discovered that using template instead of templateUrl for the directive is a workaround. |
@itsleeowen It was already fixed in master (#1494), here is the working jsFiddle with the latest AngularJS build (from master, not released yet): http://jsfiddle.net/Jnnvp/1/ Closing as duplicate of #1166 and the #1104 that you've opened as well. |
Ran into the same problem with the template vs templateUri issue. Cost me a couple hours because the issues don't seem to be related. The solution jsfiddle seems to be broken as well. Minor issue for how powerful the framework is, just stumped me for a bit. |
@mvanlonden |
Yes I was using an older version. My apologies |
directive attributes don't seem to be evaluating properly inside of ng-repeat, but are ok outside of it.
http://jsfiddle.net/ItsLeeOwen/UYkJP/
The text was updated successfully, but these errors were encountered: