Dave--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
--
Hi Dave!Do you mean just passing an object variable off the scope to a directive through an attribute? Like this: http://jsfiddle.net/joshdmiller/FHVD9/Josh
--
The docs could probably be a little bit clearer here, but the basic idea is that '@' evaluates the attribute and keeps it in sync on the directive's scope, but it doesn't take a variable directly, so you're just passing in the object string; '&' evaluates an expression to a function accessible on the directive's scope, but the expression is evaluated relative to the _directive's_ scope, so it doesn't have access to the parent's scope property; finally, '=' just passes a property from the parent scope into the directive and keeps it in sync, which is what you want in this case.For what it's worth, you could use '&' for the object literal: http://plnkr.co/edit/uIyPrk?p=preview. The key is that '&' creates a function from the expression, which must then be called to retrieve the evaluated object.Josh
...or $scope.$watch($attrs. xxColorize, function(xxColorize) {...}, true)
if the value is dynamic, like when it uses other values which may change. I am no sure if the last argument "true" is necessary.
Regards,
Witold Szczerba
---
Sent from my mobile phone.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.