Hi guys,

today i decided to tidy up the codebase of my current project as I've read 
a lot about good angular design and have made some newbie mistakes earlier.
I have a directive on <body> with a controller which keeps track of several 
"child" directives. Now i need to clean up the array in the directive 
controller on navigation, therefor I use element.on('$destroy',...).
My Problem however is, that $destroy is always fired *after *the child 
directives of the new page have already added themselves to the array, 
resulting in an empty array.
As a workaround I now listen to the $locationChangeSuccess event, but it 
puzzles me why i can't have the desired behaviour through use of $destroy.
Could someone please give me a hint?

Thank you very much,
Kevin

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