title: Get the value of an Angular button and log them into the console
body: <p>I have a very basic question.</p>
  
  <p>I have two buttons in my view, what I want to do is to assign the value of each of those buttons to a variable in my controller (<strong>"$scope.buttonValue"</strong>, <strong><em>for example</em></strong>) so every time I click on each I can log the value in the console and give the <code>$scope</code> variable a value depending on the button I click.</p>
  
  <p><h1>Basic Angular Buttons</h1></p>
  
  <pre><code>&lt;div class="btn-group" ng-init="showData = 1"&gt;
    &lt;button ng-model="showData" type="button" ng-class='{"btn btn-primary": showData == 1, "btn btn-white": showData != 1}' ng-click="showData = 1"&gt;One&lt;/button&gt;
    &lt;button ng-model="showData" type="button" ng-class='{"btn btn-primary":showData == 2, "btn btn-white": showData != 2}'  ng-disabled="!loadViewOne" ng-click="showData = 2"&gt;Two&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p><a href="https://plnkr.co/edit/UQao1VKFAWP9Mef3oCvk" rel="nofollow noreferrer">Basic Plunker.</a></p>
  
  <p>I'm new to angular and js so I need some help on this to understand more stuff.</p>
  
  <p>The buttons have some validations, and I think I'm already giving a value to showData, but I don't know how to pass that to a <code>$scope</code> in a controller.</p>