Hello,
I have a page with 2 small angular applications. Each application consists
of a directive that makes a window element draggable and inserts a titlebar
with closebox in the element it's defined on. Initially only window2 is
visible with a button1 that, when clicked, displays window 1. Thats why
window1 and button1 are in the same app / share the same scope. Now when I
click the closebox of window2 in the other ng app window2 closes but I
_also_ want the button1 in ngapp1 to disappear.
How can I do that if that element is in another application? I tried using
$scope.$emit() / $rootScope.$on() (and variations) but that does not work
- the handler designated by $rootScope.$on() never fires.
The setup looks like this
<div>
<div id="ngapp1">
<div draggable id='window1'>
<div button id="button1">
</div>
</div>
<div>
<div>
<div>
<div id="ngapp2">
<div draggable id="window2">
[..]
Can I use scope.$emit() / scope$on() to communicate between 2 different
angular apps? Does the fact that ngapp1 is not a parent of ngapp2 (it's a
nephew) matter?
Thanks
--
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.