export Class(clsDef: ClassDefinition) : ConcreteType
export Class(clsDef: ClassDefinition) : ConcreteType
exported from angular2/core defined in angular2/src/core/util/decorators.ts (line 125)
Provides a way for expressing ES6 classes with parameter annotations in ES5.
Basic Example
is equivalent to ES6:
or equivalent to ES5:
Example with parameter annotations
is equivalent to ES6:
Example with inheritance
var Shape = ng.Class({
constructor: (color) {
this.color = color;
}
});
var Square = ng.Class({
extends: Shape,
constructor: function(color, size) {
Shape.call(this, color);
this.size = size;
}
});