pocesar pocesar - 1 year ago 77
AngularJS Question

How to make it possible to use Typescript with SystemJS and Angular?

I'm trying to make SystemJS work with Typescript, but they seem to conflict with each other.

How can I take advantage of the autoloading from System.js without it conflicting with keywords on Typescript? using import / require makes Typescript using it's own way for loading and referencing files, although it translates

module.exports = ...
, it doesn't do the same for

Is it possible at all to achieve this or I'll have to wait for Typescript to support ES6 keywords?

Answer Source

TypeScript 1.5 adds support for compiling to ES5 SystemJS module syntax.

Author a class like:

export class Foo {}

Then compile with

tsc --module system foo.ts

The result will be an ES5 module using the SystemJS format.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download