Curriculum
Course: AngularJS
Login

Curriculum

AngularJS

AngularJS Tutorial

0/65
Text lesson

Checkbox

A checkbox has a value of either true or false. By applying the ng-model directive to a checkbox, you can utilize its value within your application.

Example

Display the header if the checkbox is selected.

 <form>
  Check to show a header:
  <input type=”checkbox” ng-model=”myVar”>
</form>

<h1 ng-show=”myVar”>My Header</h1>