Posts

Setting up a project in Angular 2

Image
Setting up a project in Angular 2 Step 1: Setting up the Environment. For setting up the environment you need Node.js . Make sure you are having least node 6.9.x and npm 3.x.x by running node –v in console. I am using GitBash but you can use command prompt.     npm install -g @angular/cli     This will install angular cli globally in your system. You don’t need to set environment variable for it. Once this is done we can move to Step 2. Step 2: Creating a new project. Create a new project and skeleton application by running the bellow command into your terminal.       ng new my-app                             it’ll take few minutes to set up a new project after you created the structure successfully your folder will look like below: Step 3: Serve the application: Navigate to project folder and launch the server. The ng serve command will launch the server also it will constantly watching your files, if you make any changes to the source file it will build the

What's new in Angular 2

Image
Angular 2 What is Angular? Angular is a framework for dynamic web applications. It provides a way to organize HTML, JavaScript, and CSS to keep your front-end code clean. Note: You don’t need any prior experience with Angular 1, In fact if you don’t know Angular 1. It will less confusing.  What you need to know before jumping into Angular 2? Basic JavaScript. Basic HTML & CSS. JavaScript: ES2015(optional). What is the difference between Angular 1 and 2? Speed- Angular 2 is faster. Components- instead of controller and scope, we use components, which feel simpler. Simpler Directives – Creating custom directives is much simpler. Intuitive Data Binding – When we need to link data to an HTML element or listen for a button clicking on the page, we have an intuitive syntax. Services are now just a class. Many more small improvements. It has more choice for languages. Angular 1.x is easy to setup. Where AngularJS 2 is dependent of other libraries and it