title: Get the value of an input scope with angular ng-switch
body: <p><strong><em>What it should do</em></strong> </p>
  
  <p>Each button is linked to a div block (ex: button01 links to block01). Each div block has 3 inputs. The last input gets the value of the a math function between the two inputs above it. The div blocks must "appear" not show/hide.</p>
  
  <p><strong><em>What it does</em></strong> </p>
  
  <p>The part where the three buttons open the three div blocks works. The problem is that when I try to type something inside the two inputs the last input gets nothing.</p>
  
  <p><strong><em>What I've tried</em></strong></p>
  
  <p>1) ng-switch and ng-switch-when</p>
  
  <p>2) place the divs inside each <code>(script type="text/ng-template" id="aaa")</code>
  and then;</p>
  
  <pre><code>var forms = ["aaa", "bbb", "ccc", "ddd"];
  
  credit_block.displayedForms = [];
  
  credit_block.addForm = function(formIndex) {
      credit_block.displayedForms = [];
      credit_block.displayedForms.push(forms[formIndex]);     
  }
  </code></pre>
  
  <p>3) (this one worked but it's not what I want) ng-show</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="true">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"&gt;&lt;/script&gt;
  
  
  &lt;div class="row"&gt;
     &lt;div class="col-sm-12"&gt;
       Pick a topic:
       &lt;label&gt;&lt;span&gt;Button01&lt;/span&gt;&lt;input style="display:none" type="radio" ng-model="myVar" value="block01"&gt;&lt;/label&gt;
       &lt;label&gt;&lt;span&gt;Button02&lt;/span&gt;&lt;input style="display:none" type="radio" ng-model="myVar" value="block02"&gt;&lt;/label&gt;
       &lt;label&gt;&lt;span&gt;Button03&lt;/span&gt;&lt;input style="display:none" type="radio" ng-model="myVar" value="block03"&gt;&lt;/label&gt;
     &lt;/div&gt;
    &lt;/div&gt;
    
    &lt;div class="row" ng-switch="myVar"&gt;
     &lt;div class="col-sm-12" ng-switch-when="block01"&gt;
      &lt;h3&gt;Cumpar locuinta&lt;/h3&gt;
      &lt;div class="row"&gt;
       &lt;div class="col-sm-10 col-xs-8 number-box"&gt;
        &lt;label&gt;Sum:&lt;/label&gt;
        &lt;input class="button-option" type="number" ng-model="sum"&gt;
       &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="row"&gt;
       &lt;div class="col-sm-10 col-xs-8 number-box"&gt;
        &lt;label&gt;Advancement:&lt;/label&gt;
        &lt;input class="button-option" type="number" ng-model="adv"&gt;
       &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="row"&gt;
       &lt;div class="col-sm-10 col-xs-8 number-box"&gt;
        &lt;label&gt;Value:&lt;/label&gt;
        &lt;input class="button-option" type="number" value="{{ result() }}"&gt;
       &lt;/div&gt;
      &lt;/div&gt;
     &lt;/div&gt;
    
    &lt;/div&gt;
   &lt;/div&gt;
  
  &lt;script&gt;
   var myApp = angular.module('myApp', []);
   myApp.controller('myController', function($scope) {
    $scope.sum = 5;
    $scope.adv = 4;
          $scope.result = function() {            
                  return $scope.sum - $scope.adv;
          };
      });
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>