What do you mean exactly by freeing up the DOM and clearing all the
event handlers? Especially about the handlers. As far as I know there
is no need to remove events from destroyed DOM elements or am I wrong?
For example: create a template and include it on your page using
ng-include like:
<button ng-click='toggle()' value='click me to toggle'>
<ng-include src='template'></ng-include>
function Controller($scope) {
$scope.template = '';
$scope.toggle = function() {
$scope.template && 'myTemplate' || '';
}
}
Now, clicking the button makes your template appear and disappear. If
your template has components, controllers and what-else, then (as far
as I know) there is no need for any special treatment.
Regards,
Witold Szczerba
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To post to this group, send email to
ang...@googlegroups.com.
> To unsubscribe from this group, send email to
>
angular+u...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/angular?hl=en.
>
>