title: Passing dynamic value to function parameter using Angular 1 Interpolation
body: <p>I have a function where I change the text of button based on some value</p>
  
  <pre><code>$scope.text = 'Wait';
  
  if(Number($scope.x) == Number($scope.y))
      $scope.text = 'Go'
  else if(Number($scope.x) &lt; Number($scope.y)
      $scope.text = 'Wait'
  </code></pre>
  
  <p>I then use the <code>text</code> in the HTML on the button tag</p>
  
  <pre><code>&lt;button type="submit" ng-click="proceed()"&gt;{{text}}&lt;/button&gt;
  </code></pre>
  
  <p>Either the text, <code>proceed</code> function on the button is happening. I wanted to stop calling the <code>proceed</code> function if the text is <strong>Wait</strong>. To do that, I tried something like this.</p>
  
  <pre><code>$scope.check = function(val) {
      if(val == 'Go') {
          $scope.proceed();
      }
  }
  </code></pre>
  
  <p>And I use it in the HTML like</p>
  
  <pre><code>&lt;button type="submit" ng-click="check({{text}})"&gt;{{text}}&lt;/button&gt;
  </code></pre>
  
  <p>But I get a error stating</p>
  
  <pre><code>Error: [$parse:syntax]
  </code></pre>
  
  <p>I wanted to if there's any other better way of doing it. Any help will be much appreciated.</p>