When to use $destroy() function of scope?



When to use $destroy() function of scope?..

Answer / chaitanya

$destroy() - This function permanently detached the current scope with all of its children from the parent scope. This is required when child scopes are no longer needed. Hence, $destroy() function is called to remove these scopes from the browser’s memory.

When $destroy() is called all the watchers and listeners get removed and the object which represented the scope becomes eligible for garbage collection.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More AngularJS Interview Questions

How routing works in angular 2.?

0 Answers  


Is angular harder than react?

0 Answers  


Write ajax call syntax?

0 Answers  


What is use of $routeprovider in angular js?

0 Answers  


Is wordpress a framework?

0 Answers  






What Are The Security Features Provided By AngularJS?

0 Answers  


How to setup and install ionic framework with angular 4?

0 Answers  


What are the key features of angular.js?

0 Answers  


What is the singleton pattern? How does angular use it?

0 Answers  


How does a shaking tree work?

0 Answers  


What is data binding? Explain two-way data binding?

0 Answers  


Is angularjs difficult to learn?

0 Answers  


Categories