title: Angular 1.x: How to execute various action when checkbox is checked and unchecked
body: <p>I have a HTML input checkbox field like this:</p>
  
  <pre><code>&lt;input type="checkbox"  ng-change="itemChecked()"&gt; Happy
  </code></pre>
  
  <p>My Angular 1.x code is like this:</p>
  
  <pre><code>$scope.itemChecked = function(){  
      // do something if checked
      // Eg: I have a google map and when this function is called, 
      //     it loads marker and adds businesses name.        
  
  
      // return to original state when unchecked 
      // Eg: When checked, it loads business in Google Map, 
      //     but when unchecked, its supposed to remove marker 
      //     points from google maps, as if the page loaded
  
  };
  </code></pre>
  
  <p>I am able to:</p>
  
  <blockquote>
    <p>// do something if checked</p>
  </blockquote>
  
  <p>but I am not able to revert back to original state.</p>
  
  <p>How do I do that?</p>
  
  <p>FYI: There is going to be multiple checkbox, so refreshing the page wont work. </p>