Open
Description
If I have a class like:
minion.define("core.command", {
SGSimpleCommand : minion.extend("core.observer.SGEventDispatcher", {
execute : function ()
{
throw new Error("Override execute in your subclass");
}
})
});
And I extend this class:
minion.define("application.control", {
PrepareViewCommand : minion.extend("core.command.SGSimpleCommand", {
require : [
"application.view.components.ViewComponent"
],
execute : function (event)
{
var el = document.getElementById(event.body);
el.appendChild(new this.__imports.ViewComponent());
}
})
});
then the require doesn't seem to work in the subclass as new this.__imports.ViewComponent() turns up as undefined. I can only get it to work if I use:
minion.define("application.control", {
PrepareViewCommand : minion.extend("core.command.SGSimpleCommand", {
execute : function (event)
{
var el = document.getElementById(event.body);
minion.require(["application.view.components.ViewComponent"], function (ViewComponent)
{
el.appendChild(new ViewComponent());
});
}
})
})
Is this expected behaviour?
Metadata
Metadata
Assignees
Labels
No labels