Hello Lovely People,

I am in the middle of creating an example that would illustrate the 
relationship between a component (or more specifically, an element 
directive) and a scope. I wanted to create this example where you have this 
magic contact card that reflects the contact information of the person 
who's zone you were in. So you would take this contact card and move to any 
part of your application and have it reflect the person it was inside. The 
idea was that the component is displaying the contact info of a single 
person within it's context. When the context changes/when the scope 
changes/when the person model changes, the contact info in the contact card 
would change. I feel this kind of example would better illustrate the 
decoupled relationship between a component the context set by a scope.

Here is my POC so far, just drag the middle div into a zone (the dashed 
divs) to see the person associated with that 
zone: http://plnkr.co/edit/S9fLWxkhu05Xpk5y46QG?p=preview

I achieved the scope reassigning by clearing the isolated scope of 
the drag-me-to-zone directive and copying over the user-defined properties 
of the scope inside the zone directive. Now ignoring my obvious inefficient 
system of reassigning the scope on every mouse movement, is there a better 
way I can get the scope in the drag-me-to-zone directive to be changed into 
the scope of the zone it was inside?

Best,
i❤computers

P.S. I fiddled an alternative solution with transclude: 'element', but got 
nowhere as calling a transclusion function inside the mousemove event 
handler that was inside the mousedown event handler that was inside the 
same transclusion function failed to reassign the scope. Also, that level 
of nesting made my hippo cry.

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