>
>
> What is the scope that you set? I assume you are  defining this inside a 
> directive.
>
 
>
Thanks, that was exactly the question I should have asked myself :-) As the 
code stands now, the template is compiled and linked to the scope of the 
directive in which the template is added. So the best way would be add any 
values to that scope and to access them from the child scope via 
scope.$parent. In practice this should look like:

in the directive the element is added:

     
 scope.image = "../img/thumb.png"
 event = $compile(template)(scope)

and in the scope of the directive of the newly created child:
   
scope.image = scope.$parent.image

Of course, this requires a directive, e.g. "event", which is to be attached 
to the template like:

<div class="event" event>
  <div class="event-left"></div>',
  <div class="event-right"></div>',
  <div class="event-thumbnail">
     <img ng-src="{{image}}" class="event-thumbnail-img">
  </div>',
</div>

Probably not the most elegant solution, but it works like this...

tomw

 

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