In this example we have a switch which is used for Yes No values or On and Off values. The
ng-switch directive is bind with the
$scope.val variable and by default value of this variable is true, so the switch has active class and switch is on. When you click on the switch it toggles and value of the
$scope.val variable becomes false and switch will off.