Hi,
    I have a $destroy event handler registered on a scope. 

<ng-include src='"include1.html"' ng-if="includedTemplate==1"></ng-include>
<ng-include src='"include2.html"' ng-if="includedTemplate==2"></ng-include>

include1.html registers a $destroy event handler on its scope.
Toggling the includeTemplate scope variable between 1 & 2, loads either 
include1.html or include2.html.
When this variable is changed from 1 to 2, include1.html scope gets 
destroyed and this triggers the $destroy listener registered there. 
It was found that the $id retrieved from the $event.targetScope was 
different from the one, the listener was registered against.
$event.targetScope seems to be a parent scope of the one the listener was 
registered against.

How can I retrieve the actual scope as and when destroyed?

My angularjs version is 1.4.7.

I'm sharing a sample I tried out:
https://embed.plnkr.co/RjhS5dEjI2PpSmjqzqBQ/


Regards
Parvathy

-- 
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 https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to