title: Angularjs $scope with parameter
body: <p>I'm new in Angular and I can't achieve something really simple, lets say we have several checkbox input loops followed by an <code>input</code> text field like this:</p>
  
  <pre><code>&lt;body ng-app="ngToggle"&gt;
      &lt;div ng-controller="AppCtrl"&gt;
          &lt;input type="checkbox" ng-repeat="btn in btns" ng-model="changing" ng-change="change(btn.value, 'other')" class="here" value="{{btn.value}}"&gt;
  
          &lt;input type="text" class="uncheck" ng-disabled="other"&gt;
  
  
      &lt;!-- Here comes the other one --&gt;
  
         &lt;input type="checkbox" ng-repeat="btn in btns" ng-model="changing" ng-change="change(btn.value, 'other2')" class="here" value="{{btn.value}}"&gt;
  
         &lt;input type="text" class="uncheck" ng-disabled="other2"&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>And the idea in here is this: once the checkbox with value "other" is checked it will enable the corresponding text field determinate in the field parameter of the <code>change</code> function, so I develop a function <code>change(value, field)</code> and works like this:</p>
  
  <pre><code>     $scope.btns = [
          {value:'one'},
          {value:'two'},
          {value:'other'}
      ];
  
     $scope.other = true;
     $scope.other2 = true;
  
     $scope.change = function(value, field) {
      if(value == 'other'){
          if($scope.field == false){
          $scope.field = true;
        } else {
          $scope.field = false;
        }
      }
    };
  </code></pre>
  
  <p>But the problem is, this does not work, I don't know if I making this in the right way, the <code>$scope.field</code> is the problem, how can I pass a parameter to the <code>$scope</code></p>
  
  <p>Hope someone can help me.
  Thanks.</p>