Use

  $scope.map = {a: 1, b: 2};
then
  <my-directive map="map"...

and 
scope: {map: '='}

On Thursday, January 3, 2013 9:54:58 AM UTC+11, Dave Merrill wrote:
>
> I'd like to pass a static or $scope-d object to a tag directive as an 
> attribute. Is that possible?
>
> I've tried these, among other variations:
>   <my-directive map="{a: 1, b: 2}"...
>
>   <my-directive map="{{{a: 1, b: 2}}}"...
>
>   $scope.map = {a: 1, b: 2};
> then
>   <my-directive map="map"...
> or
>   <my-directive map="{{map}}"...
>
> I've tried declaring the attribute in the directive like this:
>   scope: {map: '@'}
> and
>   scope: {map: '&'}
>
> None of those appear to work. I'm sure I'm missing something obvious. Any 
> thoughts?
> Dave
>

-- 
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/groups/opt_out.

Reply via email to