angular.scope.$destroy

Description

Remove the current scope (and all of its children) from the parent scope. Removal implies that calls to $digest() will no longer propagate to the current scope and its children. Removal also implies that the current scope is eligible for garbage collection.

The destructing scope emits an $destroy event.

The $destroy() is usually used by directives such as ng:repeat for managing the unrolling of the loop.

Usage

angular.scope.$destroy();