Question: Why AngualrJS2 over AngualrJS1?
- Angular 2 is simpler and faster than Angular 1.
- You can update the large data sets with minimal memory overhead.
- It will speed up the initial load through server side rendering.
Question: What are the feature of AngualrJS2?
- Angular 2 is faster than Angular 1
- Angular 2 is easier than Angular 1
- It supports old browsers also including IE9+ and Android 4.1+.
- It is a cross platform framework.
- Angular 2 is mainly focused on mobile apps.
- Code structure is very simplified than the previous.
Question: How to install AngualrJS2 in NodeJS?
- Create an folder and go inside that folder using command line.
- Create en empty file package.json and add following contents.
{ "name": "angular2-demo", "version": "1.0.0", "scripts": { "start": "concurrent \"npm run tsc:w\" \"npm run lite\" ", "tsc": "tsc", "tsc:w": "tsc -w", "lite": "lite-server", "typings": "typings", "postinstall": "typings install" }, "license": "ISC", "dependencies": { "angular2": "2.0.0-beta.7", "systemjs": "0.19.22", "es6-promise": "^3.0.2", "es6-shim": "^0.33.3", "reflect-metadata": "0.1.2", "rxjs": "5.0.0-beta.2", "zone.js": "0.5.15" }, "devDependencies": { "concurrently": "^2.0.0", "lite-server": "^2.1.0", "typescript": "^1.7.5", "typings":"^0.6.8" } }
- Create an empty file tsconfig.json and add following contents.
{ "compilerOptions": { "target": "es5", "module": "system", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "removeComments": false, "noImplicitAny": false }, "exclude": [ "node_modules", "typings/main", "typings/main.d.ts" ] }
- Create an empty file typings.json and add following contents.
{ "globalDependencies": { "core-js": "registry:dt/core-js", "jasmine": "registry:dt/jasmine", "node": "registry:dt/node" } }
- Execute following command from command line.
npm install