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
Tag: Angular
Bind RadioButton List in Angular 2
Earlier I posted about how to bind Select DropDown List in Angular 2 and Cascading DropDown List using Angular 2 covering some of the newest features of Angular 2 beta 8 release. And in this post, we will find out how to bind radiobutton list in Angular 2. At the time of writing this post, Angular 2 RC4 is the newest version.
Don’t use hidden attribute with Angular 2
As explained earlier in this post, Angular 2 directly uses the valid HTML DOM element properties and events unlike AngularJS 1.x pre-defined directives. So in place of ng-href
, ng-src
, ng-show
and ng-hide
, Angular 2 uses href
, src
and hidden
properties to get the same result. But don’t use hidden attribute with Angular 2 to show/hide elements. Let me tell you WHY?
Cascading DropDown List using Angular 2
Previously I posted about how to bind dropdown/select list in angular 2 and in this post, we shall find out how to create cascading dropdown list using Angular 2 by enhancing the same country list Angular 2 application.
Bind Select DropDown List in Angular 2
Earlier I posted about the differences between AngularJS 1.x and Angular 2 in which I tried to explain how things changed with respect to Angular 2.In this post, we’ll find out how to bind select dropdown list in Angular 2. Read More
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