How to use angular 2 components written in typescript inside a dart project How to use angular 2 components written in typescript inside a dart project dart dart

How to use angular 2 components written in typescript inside a dart project


There is no way to do that.

You would need to port the elements source to Dart. The ts2dart tool might help, but if the TypeScript code is not built with ts2dart in mind, then it will only be able to translate parts of the code.

You might argue that Polymer.js elements can be used in Polymer.dart, but Polymer.dart itself is just a wrapper for Polymer.js and Polymer elements are wrapped in a similar way.Because Dart Angular2 is entirely Dart code this approach is not available.

Angular also requires build tools to be applied to the components code and these build tools are different for TS and Dart.

Dart and JS Polymer elements can be use with Dart Angular2 though.