Angular 2 tutorial


Release date:2024-03-06 Update date:2024-03-07 Editor:admin View counts:64

Label:

Angular 2 tutorial

Image0

Angular2 is an open source JavaScript library maintained by Google to assistsingle-page applications.

Angular2 is an upgraded version of Angular 1.x, which has a significant improvement in performance and can well support Web development components.

Angular2, which was released in September 2016, is based on ES6.

The basic knowledge needed to learn this tutorial

Before taking this tutorial, you need to have a basic front-end foundation: HTML, CSS, JavaScript. You also need to know about NPM and TypeScript.

  • Introduction to the use of NPM.

  • TypeScript getting started tutorial

The difference between Angular2.x and Angular1.x

The difference between Angular2.x and Angular1.x is similar to that between Java and JavaScript or between Lei Feng and Leifeng Pagoda, so you need to be prepared to relearn a language when learning Angular2.x.

Operating conditions!

Since various environments (browsers or Node) currently do not support ES6 code, you need some shim and polyfill (required by IE) so that thecode written by ES6 can be converted into ES5 form and run normally in the browser.

Image1

As you can see from the figure above, the following module loaders are required under the Es5 browser:

  • systemjs -general module loader, which supports JS module loading in various formats such as AMD, CommonJS, ES6, etc.

  • es6-module-loader -ES6 module loader systemjs the module is automatically loaded.

  • traceur -ES6 transcoder to convert ES6 code into ES5 code supported by the current browser systemjs the module is automatically loaded.

Related reference documentation

Powered by TorCMS (https://github.com/bukun/TorCMS).