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 the difference between factory and service in angular 2?
What is the difference between angularjs and node.js?
What are the difference between renderer and elementref in angular 2?
What happens when the page containing angular based application loads?
Explain directives?
Explain what is Angular Expression?
What is constant?
What is difference between javascript and angular?
How to pass data into components with @input in angular 2?
What are promises in angular 2?
What is httpinterceptor in angular?
How will you implement autorefresh in angularjs?