What is the proper way to clean up/destroy directives?

Viewed 4445

Assuming I have multiple directives consisting of something like:

<mydirective id="1">...template content...</mydirective>
<mydirective id="2">...template content...</mydirective>

How do you go about destroying the directive? Usually I would do something in jquery where I $('#2').remove();

Aside from removing the specific directive from the dom, is there something else that has to be done, or some other way to destroy the dom element so you do not leave anything other "garbage" lingering? (i.e. orphan controllers, etc.)

1 Answers
Related