changes.mady.by.user Erik de Bruin
Saved on Dec 21, 2012
Saved on Dec 26, 2012
ActionScript
JavaScript + Closure annotation
Simple Class
package com.example.components { public class MyClass { public classfunction MyClass() {} } }
goog.provide('com.example.components.MyClass'); /** * @constructor */ com.example.components.MyClass = function() {};
Extending Class
package com.example.components { import com.anotherExample.components.MyBaseClass; public class MyClass extends MyBaseClass { public function MyClass() {} { super(); } } }
goog.provide('com.example.components.MyClass'); goog.require('com.anotherExample.components.MyBaseClass'); /** * @constructor * @extends {com.anotherExample.components.MyBaseClass} */ com.example.components.MyClass = function() { goog.base(this);};
goog.inherits('com.example.components.MyClass', 'com.anotherExample.components.MyBaseClass');