Why do we have install Node.js for Angular 2.0?

前端 未结 4 1159
無奈伤痛
無奈伤痛 2020-12-13 02:10

I started a tutorial on Angular 2.0, the first step in setting up the workspace is installing Node.js and NPM.

Why do we have install Node.js for Angular 2.0?

<
4条回答
  •  [愿得一人]
    2020-12-13 03:01

    Because Anglar2 is based on Typescript, Web Components and ES6 which need compilation for performance and broader browser support. Typescript is compiled to ES5 JavaScript and the other features require shims for backwards compatibility.

    Since Typescript is a superset of JavaScript, and it's compiled to JavaScript anyway, you can write your code in plain JavaScript but it's not recommended.

    For a more detailed explanation check out these videos on YouTube

    • Why Typescript
    • Instalation steps

提交回复
热议问题