Most ES6 with decorators should compile fine with the TypeScript compiler, 
as TypeScript aims to be a superset of ES. The main caveat I have found is 
that you have to declare a class member if you want to assign it in the 
constructor in an ES6-like way.

So this ES6 won't compile:

export class MyComponent {
  constructor(fooService: FooService) { this.fooService = fooService; }
}

But this ES6 will:
export class MyComponent {
  fooService;
  constructor(fooService: FooService) { this.fooService = fooService; }
}

As will this TypeScript:
export class MyComponent {
  constructor(private fooService: FooService) { }
}


On Tuesday, October 18, 2016 at 6:40:10 AM UTC-5, Darren Chiu wrote:
>
> does anyone know how to compile the angular2 code into bundle with AoT 
> instead of JiT with ES6? Couldn't found any tutorials or guide and for 
> ES6... I know it was probably a wrong choice to use ES6 over typescript 
> with angular2 but I have a huge ES6 angular2 project already...
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to