javascript - AngularJS resource not forming url correctly -


i'm having problem using angularjs resources.

i have resource looks this:

loginmodule.service('testresource', function ($resource, $location) {     var $scope = this;     $scope.resource = $resource(window.location.path+'/:event', {event:'@event'});      $scope.inputdata = function(data1, data2, success){         return $scope.resource.save({'event':'inputdata'},{'data1':data1,'data2':data2},success);     };      return $scope; }); 

and yes, i've tried using:

//  $scope.resource = $resource($location.path()+'/:event'); //  $scope.resource = $resource(window.location.path+'/:event'); //  $scope.resource = $resource(':event'); 

firebug reports address tries send 1 of these two:

http://localhost/sandbox/test/undefined/inputdata http://localhost/sandbox/test/:event?event=inputdata 

what want address of:

http://localhost/sandbox/test/inputdata 

what doing wrong? more specifically, should make right?

try $resource('./:event', ...)


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -