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 |
What is data binding in angular 7?
Do you know scope in angular?
Why is it called bearer token?
What is single page application (spa)?
What is export array in angular 2?
Explain ng-repeat directive ?
What do you understand by strict conceptual escaping?
How to disable right click event in angularjs?
How did you reverse a string?
What is the difference between angular 1 and angular 2?
Is angular a mvc?
Explain ngfor and nglf? 20. What is hoisting in js?