Why does Angular 2 use the .ts file extension?

The .ts extension is used by TypeScript. Angular 2 does not really use the .ts extension. The code produced by the TypeScript compiler will be JavaScript with the .js extension. You can also use Dart as a development language that will still produce JavaScript code. If you feel like avoiding TypeScript or Dart, you can use plain JavaScript for developing Angular 2 applications.

With TypeScript you get some options that are not available to you in plain JavaScript. The definition of TypeScript from its web site is:

TypeScript is a typed superset of JavaScript that compiles to plain JavaScript

To lean more about TypeScript visit its web site.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)