Hey sander,

That is pretty much perfect, thanks! This way I can do some string voodoo
on the incoming ngRepeat attr to make sure there's the right setup, and I
don't have to go and edit every single html template already in my code.

e


On Thu, Feb 26, 2015 at 9:01 AM Sander Elias <[email protected]> wrote:

> Hi Eric,
>
> The simplest way is to write your own ngRepeat at an higher priority, and
> just amend it.
>
> something like this:
>
>     function ngRepeat($compile, $parse) {
>         var ddo = {
>             restrict: 'A',
>             priority: 1010,
>             terminal: true, //stop Compilation
>             compile: compile
>         };
>         return ddo;
>
>         function compile(el, attr) {
>             attr.$set('ngRepeat', attr.ngRepeat + ' track by $index');
>             var ngModelLink = $compile(el, null, 1010); //restart compilation 
> at priority 9999
>             return function(scope) {
>                 ngModelLink(scope); // use the link function from the 
> compilation
>             };
>         }
>     }
>
> See it in action in this plunk
> <http://plnkr.co/edit/RpNr17M3BiFjoakDeYPt?p=preview>
> Does that help a bit?
>
> Regards
> Sander
> ​
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "AngularJS" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/angular/I9bz6MmeX1U/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to