The Angular dependency versions change as new versions are updated. See below for the most current versions.
npm install core-js reflect-metadata zone.js rxjs systemjs --save
A running theme with using Angular 2 is that we want to use great new ES6 features that aren't yet supported by browsers. This is why we need transpilers, loaders, polyfills, and shims.
These dependencies help provide some functionality for Angular 2 that make our apps better.
- core-js client/shim: Adds es6 features to browsers that don't have them
- zone.js: An execution context. Helps with change detection and showing errors. Anyone from angular 1 will know that seeing console errors and trying to debug was near impossible. Provides stack traces. Helps Angular run change detection throughout our app.
- reflect-metadata: Polyfill for decorator metadata. Used to apply decorators to our code (
Componentis a decorator). A clean way of adding metadata to our classes.
- rxjs: Libraries that help create asynchronous data streams. Gives us Observables. The Angular 2 http library uses these heavily and is the preferred way of handling async events in Angular 2.
Install them all using:
npm install core-js reflect-metadata zone.js email@example.com systemjs --save
Minor note, at the time of this course, Angular 2 requires RxJS 5.0.0-beta.12. For the latest requirement, check quickstart package.json.