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 angular and why angular?
How angular protects us from xss attacks?
What is new in Angular 8?
What is npm start?
What are the different types of filters in angularjs?
How to read data from the server?
What are the angularjs global api?
What is route params?
Define scope in angular js.
Difference between display:none & visiblity:hidden?
What are different ways to invoke a directive?
How would you make an angularjs service return a promise? Write a code snippet as an example