docs/vendor.bundle.js
function Class(clsDef) {
    var /** @type {?} */ constructor = applyParams(clsDef.hasOwnProperty('constructor') ? clsDef.constructor : undefined, 'constructor');
    var /** @type {?} */ proto = constructor.prototype;
    if (clsDef.hasOwnProperty('extends')) {
        if (typeof clsDef.extends === 'function') {
            ((constructor)).prototype = proto =
                Object.create(((clsDef.extends)).prototype);
        }
        else {
            throw new Error("Class definition 'extends' property must be a constructor function was: " + stringify(clsDef.extends));
        }
    }
    for (var /** @type {?} */ key in clsDef) {
        if (key !== 'extends' && key !== 'prototype' && clsDef.hasOwnProperty(key)) {
            proto[key] = applyParams(clsDef[key], key);
        }
    }
    if (this && this.annotations instanceof Array) {
        Reflect.defineMetadata('annotations', this.annotations, constructor);
    }
    var /** @type {?} */ constructorName = constructor['name'];
    if (!constructorName || constructorName === 'constructor') {
        ((constructor))['overriddenName'] = "class" + _nextClassId++;
    }
    return (constructor);
}
function Class(clsDef) {
    var /** @type {?} */ constructor = applyParams(clsDef.hasOwnProperty('constructor') ? clsDef.constructor : undefined, 'constructor');
    var /** @type {?} */ proto = constructor.prototype;
    if (clsDef.hasOwnProperty('extends')) {
        if (typeof clsDef.extends === 'function') {
            ((constructor)).prototype = proto =
                Object.create(((clsDef.extends)).prototype);
        }
        else {
            throw new Error("Class definition 'extends' property must be a constructor function was: " + stringify(clsDef.extends));
        }
    }
    for (var /** @type {?} */ key in clsDef) {
        if (key !== 'extends' && key !== 'prototype' && clsDef.hasOwnProperty(key)) {
            proto[key] = applyParams(clsDef[key], key);
        }
    }
    if (this && this.annotations instanceof Array) {
        Reflect.defineMetadata('annotations', this.annotations, constructor);
    }
    var /** @type {?} */ constructorName = constructor['name'];
    if (!constructorName || constructorName === 'constructor') {
        ((constructor))['overriddenName'] = "class" + _nextClassId++;
    }
    return (constructor);
}
function Class ( clsDef ) { var /** @type {?} */ constructor = applyParams ( clsDef . hasOwnProperty ( 'constructor' ) ? clsDef . constructor : undefined , 'constructor' ) ; var /** @type {?} */ proto = constructor . prototype ; if ( clsDef . hasOwnProperty ( 'extends' ) ) { if ( typeof clsDef . extends === 'function' ) { ( ( constructor ) ) . prototype = proto = Object . create ( ( ( clsDef . extends ) ) . prototype ) ; } else { throw new Error ( "Class definition 'extends' property must be a constructor function was: " + stringify ( clsDef . extends ) ) ; } } for ( var /** @type {?} */ key in clsDef ) { if ( key !== 'extends' && key !== 'prototype' && clsDef . hasOwnProperty ( key ) ) { proto [ key ] = applyParams ( clsDef [ key ] , key ) ; } } if ( this && this . annotations instanceof Array ) { Reflect . defineMetadata ( 'annotations' , this . annotations , constructor ) ; } var /** @type {?} */ constructorName = constructor [ 'name' ] ; if ( ! constructorName || constructorName === 'constructor' ) { ( ( constructor ) ) [ 'overriddenName' ] = "class" + _nextClassId ++ ; } return ( constructor ) ; }
Provides a way for expressing ES6 classes with parameter annotations in ES5.

## Basic Example

```
var Greeter = ng.Class({
constructor: function(name) {
this.name = name;
},

greet: function() {
alert('Hello ' + this.name + '!');
}
});
```

is equivalent to ES6:

```
class Greeter {
constructor(name) {
this.name = name;
}

greet() {
alert('Hello ' + this.name + '!');
}
}
```

or equivalent to ES5:

```
var Greeter = function (name) {
this.name = name;
}

Greeter.prototype.greet = function () {
alert('Hello ' + this.name + '!');
}
```

### Example with parameter annotations

```
var MyService = ng.Class({
constructor: [String, [new Optional(), Service], function(name, myService) {
...
}]
});
```

is equivalent to ES6:

```
class MyService {
constructor(name: string, \@Optional() myService: Service) {
...
}
}
```

### 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;
}
});
```
@suppress {globalThis}
\@stable
@param {?} clsDef
@return {?}
Provides a way for expressing ES6 classes with parameter annotations in ES5 .