add support for controller.prototype.onunload

This commit is contained in:
Leo Horie 2014-05-11 22:20:47 -04:00
parent 762eeb7e31
commit b23ffd1aee
7 changed files with 86 additions and 6 deletions

View file

@ -222,6 +222,7 @@ Mithril = m = new function app(window) {
if (index < 0) index = roots.length
roots[index] = root
modules[index] = module
if (controllers[index] && typeof controllers[index].onunload == "function") controllers[index].onunload()
controllers[index] = new module.controller
m.endComputation()
}