Get qualified class name of module

3 views
Skip to first unread message

Patrick Wolleb

unread,
Oct 25, 2011, 5:00:39 AM10/25/11
to Jingo Users
Hi,

I wonder if someone can help me:

Is it possible to access the name property of the
module('com.subumbo.util.ListItem') within the object Listitem and
return this value in getQualifiedClassName?

jingo.declare({
name: 'com.subumbo.util.ListItem',
require: ['com.subumbo.util.Class'],
as: function() {
ListItem = Class.extend({

getQualifiedClassName: function() {
return 'com.subumbo.util.ListItem';
}
});
}
});

Thanks,
Patrick

Sean Duncan

unread,
Oct 25, 2011, 1:40:29 PM10/25/11
to Jingo Users
The module's metadata is available via the 'this' reference within the
module body callback. So you could write your example like the
following:

jingo.declare({
name: 'com.subumbo.util.ListItem',
require: ['com.subumbo.util.Class'],
as: function() {
var module = this;
ListItem = Class.extend({
getQualifiedClassName: function() {
return module.name;
}
});
}

});

Properties of the module metadata should be considered read-only.
Also bear in mind that properties contained in the module metadata
aren't really part of the published Jingo interface.
Reply all
Reply to author
Forward
0 new messages