Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 export as module.exports = ..., it doesn't do the same for import

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

like image 519
pocesar Avatar asked Nov 11 '14 06:11

pocesar


1 Answers

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.

like image 189
Micah Zoltu Avatar answered Oct 13 '22 06:10

Micah Zoltu