在我的控制器中:
UserResource.find({ userId: userId }, function (records) {
$scope.user= records;
});
在我的资源中:
angular.module("main_k").
factory("main_k.service.resource.Order", ["$resource", function ($resource) {
return $resource("../rest/user/:action?:identification", {
action: "@userId",
identification: "identification51854"
}, { find: { method: "GET"}
});
}]);
问题是 userId 被附加到 url 而不是被填充到操作中。标识填写正确。为了传递 userId 值,我做错了什么?