angularjs - Angular JS 2.0 compiling typescript into javascript -
i trialling angularjs 2.0 poor mans reddit. have following script called app.ts
///<reference path="typings/angular2/angular2.d.ts" /> import { component, view, bootstrap, } "angular2/angular2"; @component({ selector: 'hello world' }) @view( { template: `<div>helloworld</div>` }) class helloworld { } bootstrap(helloworld) however, after saving this, i'd compile javascript (js file) using tsc app.ts think should work, compiler spits out number of errors command line.
i have installed tsc via npm install -g 'typescript@^1.5.0-beta' , ran npm install. errors along lines of:
c:\angular2-reddit\typings\angular2\angular2.d.ts(7,22): error ts1005: ')' expec ted. c:\angular2-reddit\typings\angular2\angular2.d.ts(14,6): error ts1008: unexpecte d token; 'module, class, interface, enum, import or statement' expected. can shed light on doing wrong here?
thanks...
you need provide couple of parameters compiler work.
> tsc.cmd -m commonjs -t es5 --emitdecoratormetadata app.ts also make sure have proper typescript definition files definitelytyped repo.
> npm install -g tsd@^0.6.0 > tsd install angular2 es6-promise rx rx-lite
Comments
Post a Comment