Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : Clean up on control/view removal

$
0
0
Why don't you have the routing control to the following:

1. When the route changes have it empty the main DOM container
2. Then have it add an empty placeholder DOM element and attach the new sub control to that placeholder DOM

What this will do is when you empty the main DOM element it will remove the element that the sub control is on and that will automatically call the control's destroy method.

Viewing all articles
Browse latest Browse all 3491

Trending Articles