Appframe Knowledge Base


1 hits
0

JavaScript Conventions - Inheritance

(function(scope, undef) {
    "use strict";
	
	var w = scope.window, af = w.af, c = af.common;

	function MyChildControl() {
        var that = this, priv = {
            myVariable: 54321
        };
    }
	/* The line below will create an instance of the control you want to inherit from,
       and assign it to the prototype property of your constructor. */
	MyChildControl.prototype = new af.controls.MyControl();
	
	// Remember to only expose what you want exposed
	c.expose("af.controls", MyChildControl);
	
}(this));

components web · Perma link post comment Posted by: Jarl Erik Schmidt (08-mar-2012)