When I use angularjs, lately I have gotten into the habit of taking advantage of the directive $destroy event, usually I do something like
$scope.$on('$destroy', function() {
$element = null;
$attrs = null;
outOfScopeVariable = null;
});
My questions are,
- What's really necessary to do here?
- How does this work with transcluded directives?
- Best practices?