ClassUtil is a utility class that handles class-related tasks such as creating new classes.
Type:Function
Static
Returns the Function object that has the specified class name, not the instance.
Parameter | Type | Description |
---|---|---|
className Required | Function | The class name. |
The Function object.
Type:undefined
Static
Makes the subclass inherits the super class.
Parameter | Type | Description |
---|---|---|
subClass Required | Function | The class that inherits the super class. |
superClass Required | Function | The super class. |
Undefined.
Type:Unit
Static
Creates a new Function object that inherits the super class given. Note that the created object is not an instance. If the tagName option is set, the tag name will be tied to the newly created class.
Parameter | Type | Description |
---|---|---|
className Required | String | The class name of the unit to create. |
settings Required | Object | The unit's settings object. This settings will be returned in Unit._getSettings(). |
superClass Default:Unit | Function | The super class to inherit. |
tagName | String | The tag name for the new unit. By inserting this tag into the HTML the unit will be instantiated. |
A created function object.
// Create Search pad unit. var PadSearch = BITSMIST.v1.ClassUtil.newUnit("PadSearch", { "setting": { "path": "common" } }, BITSMIST.v1.Unit, "pad-search"); // Add search() method to the created unit PadSearch.prototype.search = function(keyword) { ... };
<html> ... <body> <!-- Instantiation --> <pad-search></pad-search> </body> </html>