Indeed, the $destroy() method will not work on $ rootScope (see here ). I worked on this by calling $rootScope.$broadcast("$destroy") rather than .$destroy() when excluding the entire Angular instance in our application. Thus, all destructors are called the same way.
Regarding the event of the $ destroy element, I have to admit that I didnβt even know about it just a few days ago ... I did not see it anywhere in the documents, plus I use jQuery according to here , it still will not work.
Link from here
This is a long description, but you can manually clean RootScope using the following methods
Option 1
Clear rootScope variable
$rootScope.currentStatus = ""; //or undefined
Option 2
if you want to remove whole $ anchop objects,
$rootScope=undefined //or empty
Ramesh rajendran
source share