Skip to main content
How to Bind Click event in Angular 2

How to bind Click event in Angular 2

In this short post, find out how to bind click event in Angular 2. ngClick is used in Angular 1.x to bind the click event but things changed in Angular 2. One of the major change in Angular 2 is, that it directly uses the valid HTML DOM element properties and events. So take the HTML event and wrap it with parentheses. So with Angular 2, use (click) to attach a click event in Angular 2. Read difference between Angular 1.x and Angular 2 to know more about other differences. Read More

Difference between Angular 1x and Angular 2

Difference between Angular 1.x and Angular 2

Angular 2 is still in beta (at the time of writing this post), but it has already created a buzz in community. Angular 2 will be a huge learning curve for developers. It is written entirely in Typescript and meets the ES6 specification. And it’s not an update for Angular 1.x. As it’s rewritten and includes breaking changes. So the best way to learn is to compare with Angular 1.x and find out what’s new in Angular 2. In this post, find out difference between Angular 1.x and Angular 2.
Read More