title: Check if checkbox is checked or not in Angular
body: <p>How to check if checkbox is selected/checked in this Angular example?
  So when user select/check first check box I want to get <strong>true</strong> and when unselect/uncheck it I want <strong>false</strong>.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>angular.module('app', [])
    .controller('Controller', function($scope) {
      $scope.toggleSelection = function toggleSelection() {
        // how to check if checkbox is selected or not
  
      };
    })</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"&gt;&lt;/script&gt;
  &lt;div ng-app="app" ng-controller="Controller"&gt;
    &lt;h1&gt;Get checkbox selection (true/false)&lt;/h1&gt;
    &lt;label&gt;
      &lt;input id="one" type="checkbox" ng-click="toggleSelection()"&gt;This
    &lt;/label&gt;
    &lt;br&gt;
    &lt;label&gt;
      &lt;input type="checkbox" ng-click="toggleSelection()"&gt;That
    &lt;/label&gt;
    &lt;br&gt;
    &lt;label&gt;
      &lt;input type="checkbox" ng-click="toggleSelection()"&gt;Lorem
    &lt;/label&gt;
    &lt;br&gt;
    &lt;label&gt;
      &lt;input type="checkbox" ng-click="toggleSelection()"&gt;Ipsum
    &lt;/label&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>