0. Introduction
Angular1, as the most Popular front-end mv* framework, has brought great convenience to front-end development. However, there are still many bad places that are hard to change. The angular team developed a new angular, Angular2, based on the trends in web development and the experience gained in ANGULAR1.
1. Advantages
ANGULAR2 has made radical changes and the results are obvious.
- Greatly improves performance
- More powerful modularity
- Improved Dependency Injection
- Friendly to Web Component
- Native mobile Support-IOS and Android
- Server-side rendering, search engine optimization
2. Tool Chain
Because ANGULAR2 is future-oriented and uses a lot of technology that is not yet supported by the current mainstream browsers, it is not an easy thing to run, so we need a toolchain:
SYSTEMJS-Universal Module Loader supports JS module loading in various formats such as AMD, CommonJS, ES6, etc.
ES6-MODULE-LOADER-ES6 Module Loader, SYSTEMJS will automatically load this module
Traceur-es6 transcoding to convert the ES6 code to the ES5 code supported by the current browser. SYSTEMJS will automatically load this module.
3, Angular2 Hello worldStep1, download angular2
https://angular.io/is Angular2 's official website and we need to download ANGULAR2:NPM install Angular2 https://www.npmjs.com/package/angular2 via NPM.
STEP2, introduction of ANGULAR2
<!DOCTYPE html>
STEP3, Hello Angular<body> <app></app> <script> var App = ng.Component({ selector: ‘app‘, template: ‘
Learn Angular2 with me (1-first experience)