Closed GoogleCodeExporter closed 9 years ago
(Sorry for the delay.)
No, but I am working on it. For the moment, classes have no name.
I am making an extension to add classes to namespaces (also called packages).
But it can still take a few weeks until it is completed.
From your question, I don't clearly understand if you speak about getting the
name of a class, or getting its type.
What you can do for now:
- to add names to your classes: add a _static object to all the classes with
the name:
MyKlass = $.klass({ _static: { name: "MyKlass" }, init:... });
Then you have: MyKlass.name === "MyKlass"
But it wont allow you to find a class from it's name. That is what namespace will be for.
- to get the class of an instance:
klass = instance.init;
It also works with:
klass = instance.constructor;
Original comment by jlgr...@yahoo.fr
on 12 Jul 2012 at 5:46
There is now an extension for namespaces. See
http://code.google.com/p/jquery-klass-plugin/wiki/Namespace
Hopefully, it should cover your needs.
Original comment by jlgr...@yahoo.fr
on 16 Jan 2013 at 5:06
Original issue reported on code.google.com by
ravenous...@gmail.com
on 25 Apr 2012 at 11:30