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

Re : Controllers on parent element are getting destroyed when a child element is removed from the DOM which has controller - this is happening recursively

$
0
0
I am using can.jquery-all.js 1.1.5 version.

Yes, the html structure is similar

Login controller is on #body-container and this div will never be removed from the DOM.

In my design each page has a container ejs which will create all required controller for that page using control helper method(see jsfiddle) which is similar to jmvc plugin helper. The controller will render the page fragments within the page container element.

#body-container container will never be removed only page container will be replaced with other page containers



To log the controllers getting destroyed I added below code in Base

"destroy" : function () {

console.info(this.element, "destroyed");

this._super();

}




Viewing all articles
Browse latest Browse all 3491

Trending Articles