我有 wcf 服务,方法是 GetLayoutData。我为此编写了以下代码:
var app = angular.module('bundleModuleApp', ['ngResource', 'mydirectives']);
app.factory('masterResource', function ($resource)
{
var src = $resource("../BundleService/BundleComponents.svc/GetLayoutData/:bundlename", { bundlename: "@bundlename" },
{
GetData: { method: "GET", params: {}, isArray: false },
GetDataById: { method: "GET", params: { bundlename: "Iotasol" }, isArray: false }
});
return src;
});
function LayoutController($scope, masterResource) {
$scope.LayoutBean = masterResource.GetDataById();
}
现在我想指定完整的服务网址,例如:
http://www.abc.com/BundleService/BundleComponents.svc/GetLayoutData/:bundlename
代替:
../BundleService/BundleComponents.svc/GetLayoutData/:bundlename
谁能告诉我如何动态传递完整的服务网址