title: AngularJS WebAPI passing parameters
body: <p>I'm new to Angular but have experience with ASP.NET MVC so the basic concepts here are not new to me.  I am trying to pass a simple text parameter to my WebAPI controller something like the word 'park', the WebAPI controller then would do a linq query and return the results to Angular which would display those results with ng-repeat in a veiw.  It works fine in the case where I return all the rows from the database but when I try to pass in a keyword parameter nothing happens.  What is the simplest way to pass in a parameter from Angular into the WebAPI controller for use there in the database linq query? Thank you.</p>
  
  <p>AngularJS code:</p>
  
  <pre><code>var PhrasierApp = angular.module("Phrasier", ["ngRoute", "ngResource"]).
      config(function ($routeProvider) {
          $routeProvider.
              when('/', { controller: DialogCtrl, templateUrl: 'dialog.html' }).
              otherwise({ redirectTo: '/' });
      });
  
  
  PhrasierApp.factory('Phrase', function ($resource) {
      return $resource('/api/Phrase/:Keyword1', { Keyword1: 'park' }, { update: { method: 'PUT' } });
  });
  
  
  var DialogCtrl = function ($scope, $location, Phrase) {
         $scope.phraseResults = Phrase.query();
  };  
  </code></pre>
  
  <p>Web API Controller:</p>
  
  <pre><code>    public IQueryable&lt;Phrase&gt; GetPhrases(string Keyword1)
      {
          var model = from p in db.Phrases where p.Text.Contains(Keyword1) select p;
          return model;
      }
  </code></pre>
  
  <p>Partial View:</p>
  
  <pre><code>&lt;table class="table"&gt;
  
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
  
      &lt;tbody&gt;
          &lt;tr ng-repeat="phraseResult in phraseResults"&gt;
              &lt;td&gt;{{phraseResult.Text}}&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  
  &lt;/table&gt;
  </code></pre>