Angular JS’ ng-checked Directive

In this Article we will learn how we can Checked or unchecked of check box or radio button using ng-checked. Normally we can checked or unchecked of checked box or radio button either from HTML tag or jQuery. I came across a need of checked or unchecked using Angular JS. Here I am going to use Visual Studio application.

let us


Supported by <input> elements of type checkbox or radio.

Note :

An expression that will set the element’s checked attribute if it returns true.

Create a Controller Class within Controller Folder

To create a MVC controller, just right click on your controller folder and click Add, Controller, then select MVC 5 Controller- Entry and given named “DataController”. Below is code

To create Angular Controller,just right click Controller Folder given named “DataCtrl” which have  ScriptsNg

Below is Code

Create View

To create View right button click Index method within DataController class given “Index”

Bellow is code

Hope this will be helpful.



One thought on “Angular JS’ ng-checked Directive

Leave a Reply

Your email address will not be published. Required fields are marked *