Skip to content

Instantly share code, notes, and snippets.

@johnlindquist
Created May 2, 2015 22:13
Show Gist options
  • Save johnlindquist/e5a144a480bc8f8cfabe to your computer and use it in GitHub Desktop.
Save johnlindquist/e5a144a480bc8f8cfabe to your computer and use it in GitHub Desktop.
/// <reference path="typings/angular2/angular2.d.ts" />
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
}
};
if (typeof __metadata !== "function") __metadata = function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
if (typeof __param !== "function") __param = function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var angular2_1 = require("angular2/angular2");
var di_1 = require("angular2/src/core/annotations_impl/di");
var MyAppComponent = (function () {
function MyAppComponent(style) {
console.log(style);
this.name = 'Alice';
}
MyAppComponent = __decorate([
angular2_1.Component({
selector: 'my-app'
}),
angular2_1.View({
template: '<h1>Hello {{ name }}</h1>'
}),
__param(0, di_1.Attribute('style')),
__metadata('design:paramtypes', [Object])
], MyAppComponent);
return MyAppComponent;
})();
angular2_1.bootstrap(MyAppComponent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment