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.
Setting up Angular 2 in your application is quite time-consuming compare to AngularJS 1. For setting up Angular 1.x, all you need to do is to just add the reference of library but with Angular 2, it requires some more work due to dependency on Grunt or Gulp for build process, TypeScript and it’s compiler. And setting this with Visual Studio 2015 is even more time-consuming. Angular Team is aware of this and they came up with a solution and introduced a new command line tool (cli) for Angular 2. Yes, Angular CLI is here for Angular 2 applications.
Earlier I posted about Cascading DropDown List using Angular 2 and in this post, we take it to next level and implement it with ASP.NET Core Web API and Angular 2. But starting/configuring AngularJS 2 with ASP.NET Core is not straightforward and it requires some manual configurations to be done. If you are not sure how to do it, I recommend you to read this helpful post to find out post how to start with Angular 2 in ASP.NET Core with TypeScript using Visual Studio 2015.
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-hide, Angular 2 uses
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?