Hi Michał, I did small changes to Your fiddle and it seems to work now:
ng-repeat is now changed and placed in outer div. Check this out: http://jsfiddle.net/0noruwjo/ Mateusz W dniu wtorek, 14 października 2014 12:03:50 UTC+2 użytkownik Michał Kocztorz napisał: > > Hi everyone, > > I'm new to angular, so it's possible that what I'm trying to achieve is > just wrong, but here's the problem: > > - I got parent directive containing some model in it's scope (list of > objects, indexed by ID) > - I got child directive that is supposed to do something with an element > of that list. It has isolated scope and is supposed to bind one of the > elements in parent's collection using "element' attribute into it's scope. > - Parent directive uses ng-repeat to create child directive for every > element of it's collection. Additionally it adds "element" attribute so the > child directive could bind it's scope to one of the elements in collection. > > Problem is that when ng-repeat runs it seems to execute the child > directive before it evaluates the "element" attribute. This makes the child > directive to fail when binding the scope. > > It seems that ng-repeat should evaluate the "element" attribute first and > then execute the child directive. > > I made a simplified example on jsfiddle: http://jsfiddle.net/0k4w7zd0/5/ > > Thanks for any help in advance! > Michał > -- 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.
