Thanks Sander,

I understand both object attributes access methods and this was not the
issue here. The problem was that angular failed to evaluate {{key}}
expression in ng-repeat before my custom directive was executed.

Michał

On Thu, Oct 16, 2014 at 4:38 PM, Sander Elias <[email protected]> wrote:

> Hi Michal,
>
> I didn’t look at your code at all, so I might be slightly off here ;)
>
> your second sample is an expression inside an expression. While this is
> possible,
> it will not work by itself.
>
> the first one is just a simple JS variable, that angular can parse in 1
> go. It’s more a JavaScript
> thing then an angular one.
>
> In JS those two are exactly the same: object.propertyName ===
> object["propertyName"]
> Notice how the second variant uses a sting to fetch the propertyName.
> this means you can do
>
>    var key = 'propertyName'
>    var result = object[key]
>
> This can be very handy from time to time.
> If you have some more questions, just ask!
>
> 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/Qn15OWje7m0/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.
>



-- 
Best regards,

Michał Kocztorz

Skype ID: michal_kocztorz


Polcode SA

ul. Hoża 13, 00-528 Warszawa

http://www.polcode.com/

T: +48 22 825 50 47


Spółka zarejestrowana w Sądzie Rejonowym dla m.st. Warszawy XII, Wydział
Gospodarczy KRS pod numerem 0000482235, NIP PL 701-021-72-88, o kapitale
zakładowym 300.000 zł, wpłaconym w całości.

-- 
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