Background: I am creating a directive based bgDropdown of angularstrap. My goal is to create a similar widget HTML select element, but with custom templates for each element.
The widget works fine. but using Batarang discovered that whenever the user displays the dropdown child scopes are created and are never destroyed. Thus, each time the dropdown is displayed more and more child scopes are created.
I need to understand how to do a proper cleaning of the children scopes.
Sample plunk: http://plnkr.co/edit/xP6HS9?p=preview
Step 1: Before first click.
Step 2: After first click and after to closed.
Step 3: After various opens and closes.