Reputation: 147
Is it possible to mix the three Languages in one Angular-2 Project, e.g. writing the App in Typescript a Componet in Dart an another in JS?
Upvotes: 2
Views: 1001
Reputation: 658037
JS is TypeScript. TypeScript is a superset of JavaScript but if you use the Angular2 JS library to build components, it's unlikely that these components will work with components built with TS (not entirely sure here).
You definitely can't mix Dart with any of the other two.
An Dart Angular2 application depends on being built as a whole and this won't work with mixed in JS or TS components.
What can be done is to bootstrap 3 root components where each one is built with a different language, but within one root component mixing languages is unlikely or impossible to work (see above).
Upvotes: 4
Reputation: 244
Yes, it is possible since they are all will be translated to JS, but I would not recommend doing that. The reason to avoid such a mix is that it will be difficult to maintain the code. Each of these languages has its own patterns and ways of doing things. By mixing them you will need to create redundant abstractions and mappings (e.g. TypeScript typings for Dart's components), unit-tests will be segregated by technology. Just imagine that one day you will need to add one more developer to the project. If there is only one of these technologies the search and evaluation of a candidate will be as simple as specifying a single skill in a job description. But when you have 3 of them it becomes difficult to find a developer having all these skills. Even if you will find this "ninja" there is still a need to teach him how you are using the mix. You will need to explain to him all hacks/tricks of build scripts and then transfer a sacral knowledge when and why to prefer one technology over another. I would recommend you to stick to TypeScript because it is a superset of JS and its features are compliant with ECMA standard.
Upvotes: 1