Whenever I use the directive inside myself, the page freezes and consumes more and more processor and RAM until the tab freezes.
I have it
Application.Directives.directive('somed', function() {
return {
restrict: 'E',
templateUrl: 'directives/somed/view.html',
replace: true
};
});
and template for example
<div ng-if="nonexistent">
<somed></somed>
</div>
Which should never load a nested directive (the ng-if value is false, so the content is not displayed. This is confirmed if I put the div tag instead of somed). However, the browser is hanging on it.
Why, and how can I prevent it?
source
share