As I delve into the Angular2 Quickstart, I stumbled upon a peculiar issue within app.component.js
after compiling app.component.ts
using tsc
(version 1.8.2):
if (d = decorators[i])
I am unable to pinpoint where I may have gone wrong in configuring the quickstart sample. Any assistance would be greatly appreciated!
This is my code:
app.component.ts
import {Component} from 'angular2/core';
@Component({
selector: 'my-app',
templateUrl: '/templates/AppComponent.html'
})
export class AppComponent {
public name: string = "My test app";
}
package.json
{
"name": "iSandBox",
"version": "1.0.0",
"scripts": {
"start": "concurrent \"npm run tsc:w\" \"npm run grunt\" \"npm run lite\" ",
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"typings": "typings",
"postinstall": "typings install",
"grunt": "grunt"
},
"license": "ISC",
"dependencies": {
"angular2": "2.0.0-beta.7",
"systemjs": "0.19.22",
"es6-promise": "^3.0.2",
"es6-shim": "^0.34.4",
"reflect-metadata": "0.1.3",
"rxjs": "5.0.0-beta.2",
"zone.js": "0.5.15"
},
"devDependencies": {
"concurrently": "^2.0.0",
"grunt": "^1.0.0-rc1",
"grunt-contrib-copy": "^0.8.2",
"grunt-contrib-jshint": "~1.0.0",
"grunt-contrib-nodeunit": "~0.4.1",
"grunt-contrib-uglify": "~0.11.1",
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-rename": "^1.2.2",
"gulp-tslint": "^4.3.2",
"gulp-uglify": "^1.5.3",
"gulp-util": "^3.0.7",
"lite-server": "^2.1.0",
"typescript": "^1.7.5",
"typings": "^0.6.8"
},
"ambientDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#6697d6f7dadbf5773cb40ecda35a76027e0783b2"
}
}
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
},
"exclude": [
"node_modules",
"typings/main",
"typings/main.d.ts"
]
}
app.component.js
System.register([ 'angular2/core' ],
function(exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
var __decorate = (this && this.__decorate)
|| function(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target
: desc === null ? desc = Object
.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
/*=================HERE===>>>>*/ if (d = decorators[i])
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return
c > 3 && r && Object.defineProperty(target, key, r), r;
};
var core_1;
var AppComponent;
return {
setters : [ function(core_1_1) { core_1 = core_1_1; } ],
execute : function() {
AppComponent = (function() {
function AppComponent() {
this.name = "My test app";
}
AppComponent = __decorate(
[core_1.Component({
selector : 'my-app',
templateUrl : '/templates/AppComponent.html'
}),
__metadata('design:paramtypes',[]) ], AppComponent);
return AppComponent;
}());
exports_1("AppComponent", AppComponent);
}
}
});
// # sourceMappingURL=app.component.js.map