How to contact a non-standard API using Angular ngResource
<p>The API I am using requires a non-standard where clause if I try to search for a particular non-id field.  The endpoint I need is:</p>

<p><a href="http://127.0.0.1:4001/api/testusers/findOne?userName=Anton" rel="nofollow">http://127.0.0.1:4001/api/testusers/findOne?userName=Anton</a></p>

<p>So this will find me the first record in the testusers table whose column (userName) = 'Anton'.</p>

<p>My standard service is:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>angular.
  module('shared.testUser').
  factory('TestUser', ['$resource',
    function($resource) {
      return $resource('http://127.0.0.1:4001/api/testusers/:id', {id:'@id'},//parameters
            {
                update: {
                      method: 'PUT' // To send the HTTP Put request when calling this custom update method.
                }
                 
            });
    }
  ]);</code></pre>
</div>
</div>
</p>

<p>and my calling function is:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>    self.checkUsersEntryDirection = function(){ //NOT WORKING
      self.testuser = TestUser.get({ username: 'anton' }, function() {
        console.log(angular.toJson(self.testuser));
      }); // get() returns a single entry
    }</code></pre>
</div>
</div>
</p>

<p>Clearly this doesn't work and I can't use the standard get approach. Can anyone think how this can be achieved?</p>