0

I am using AngularJS and I want to create one service that consumes a REST API.

The service definition is like

function DiscoveryService($resource, userContextService) {
    var apiBaseUrl = userContextService.getApiBaseUrl();
    return $resource(apiBaseUrl + '/ports/:transferId/discovery/:messageId',
        null, {
            update: {
                method: 'PUT'
            },
            get: {
                method: 'GET'
            },
            remove: {
                method: 'DELETE'
            }
        });
}
DiscoveryService.$inject = ['$resource', 'userContextService'];
module.exports = DiscoveryService;

the problem is that in some pages the :transferId and :messageId work, Url is being built properly (e.g. ports/12323435/discovery/2).

In some other pages don't work. Url is /ports/discovery without the ids. I track it in Fiddler.

Could anyone please explain how the :trasnferId works? or link to a relating webpage?

thanks for any help

R. Richards
  • 24,603
  • 10
  • 64
  • 64
user3417479
  • 1,830
  • 3
  • 18
  • 23

0 Answers0