What I need is the functionality of two ng-views. Because I can\'t I want to change the innerHTML of something and compile it. The problem I have is when I change the content ag
To manually remove the element do an element.remove()
. Sounds like you also want to destroy the scope of your compiled element so you can do that too by doing scope.$destroy();
or $scope.$destroy();
depending on if you're in a directive or not.
http://docs.angularjs.org/api/ng.$rootScope.Scope#$destroy