0

I want to make a search query to my server with angularjs resource object and i have written such an resource object;

app.factory('EcriDeviceListService', function ($resource) { var Url = "http://localhost:60766/api/EcriDeviceLists/:id/:queryText"; return $resource(Url, { id: '@Id' },{ update: { method: 'PUT' },'search': { method:'GET', {queryText:''}}) });

with this code i want to make a search query like this;

EcriDeviceListService.search({queryText:'abc'})

http://localhost:60766/api/EcriDeviceLists/queryText=abc"

how should i configure my resource object.

Thanks.

1 Answer 1

2

You should configure $resource object like this:

$resource('http://localhost:60766/api/EcriDeviceLists/:id/:queryText', { 
        id: '@Id', 
        queryText: '' 
    }, { 
        update: { 
            method: 'PUT' 
        }, 
        search: {
            method: 'GET'
        }
    });
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.