title: Angularjs: How to pass a input value to a function?
body: <p>I have an input and I need when pressing 'Enter' to call a function to reload the listed items. For that I am using </p>
  
  <pre><code>ng-keyup="$event.keyCode == 13 ? loadItems('a constant') : null"
  </code></pre>
  
  <p>that works quiet well when using a constant value at the loadItems call, but as soon as I want to pass the input value I get an error:</p>
  
  <pre><code>&lt;input id="input-search" name="mysearch" ng-keyup="$event.keyCode == 13 ? loadItems({{mysearch}}) : null" placeholder="Search"&gt;
    &lt;span id="input-search-clear" class="fa fa-times-circle"&gt;&lt;/span&gt;
  &lt;/input&gt;
  </code></pre>
  
  <p>That is what I get</p>
  
  <pre><code>http://errors.angularjs.org/1.2.14/$parse/syntax?p0=mysearch&amp;p1=is%20unexpected%2C%20expecting%20%5B%3A%5D&amp;p2=36&amp;p3=%24event.keyCode%20%3D%3D%2013%20%3F%20loadItems(%7B%7Bmysearch%7D%7D)%20%3A%20null&amp;p4=mysearch%7D%7D)%20%3A%20null
  at Error (native)
  at http://localhost:8080/vendor/angular-1.2.14/angular.min.js:6:450
  at Ya.throwError (http://localhost:8080/vendor/angular-1.2.14/angular.min.js:158:422)
  at Ya.consume (http://localhost:8080/vendor/angular-1.2.14/angular.min.js:159:394)
  at Ya.object (http://localhost:8080/vendor/angular-1.2.14/angular.min.js:167:45)
  at Ya.primary (http://localhost:8080/vendor/angular-1.2.14/angular.min.js:158:57)
  at Ya.unary (http://localhost:8080/vendor/angular-1.2.14/angular.min.js:164:273)
  at Ya.multiplicative (http://localhost:8080/vendor/angular-1.2.14/angular.min.js:164:6)
  at Ya.additive (http://localhost:8080/vendor/angular-1.2.14/angular.min.js:163:376)
  at Ya.relational (http://localhost:8080/vendor/angular-1.2.14/angular.min.js:163:240) &lt;input id="input-search" name="mysearch" ng-keyup="$event.keyCode == 13 ? loadItems({{mysearch}}) : null" placeholder="Search"&gt; 
  </code></pre>