Resolve the scan finding

Chandana1
Tera Contributor

Resolve this Scan finding  please help me 

Short description : Always deregister $rootScope.$on listeners on the scope $destroy event

Resolution details: I attached in picture

3 REPLIES 3

Mark Manders
Mega Patron

It tells you exactly what to do (the record and what to do with it). 

As was already mentioned on Telegram: what are you asking exactly?

 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Shivam Vish
Tera Contributor

Hi chandana,
please use below code for destroy and rescan and test:
$scope.$on('$destroy', function() { derigister(); });

Shivam Vish
Tera Contributor

Hi chanadana,
Please use below code for destroying the event:
$scope.$on('$destroy', function() { deregister(); });