menu

SiteGenesis / Server-side JS / Class: Class

util/Class~ Class

new Class()

Base class which allows simple inheritance.

Source:
Example
var MyClass = Class.extends({
    init : function(){
        // do some construction
    }
})

// you can call the super class's method from within any method like this
...
    myMethod : function(){
        // call 'myMethod' of super class
        this._super();
    }

Methods

extend(prop) → {Object}

Create a new sub class

Parameters:
Name Type Description
prop Object

An object defining the members of the sub class

Source:
Returns:

The sub class

Type
Object

X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.