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 the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to