所以我有一个主模块app定义为
app = angular.module("app", ['app.social_accounts', 'restmod'])
其restmod模块已配置:
app.config(function(restmodProvider) {
restmodProvider.rebase({
$config: {
primaryKey: "id",
style: "ams",
urlPrefix: "/app/"
}
});
});
它按预期工作:请求已发送到http://localhost:8000/app/...
现在我想restmod在子模块中使用app.social_accounts,通过
app = angular.module("app.social_accounts", ['restmod'])
app.config(function(restmodProvider) {
restmodProvider.rebase({
$config: {
primaryKey: "id",
style: "ams",
urlPrefix: "https://graph.facebook.com/"
}
});
});
app.factory("Album", ["restmod", function(restmod){
Album = restmod.model("/me/albums/")
return {
"get": function(){Album.$search()}
}
}])
即我想url在子模块中使用 absolute app.social_accounts。
但是当我将Album(在 下注册app.social_accounts)注入到controller DashboardCtrl下app时,请求被发送到http://localhost:8000/app/me/albums/.
所以我想知道这里发生了什么以及如何实现单独url的 for restmodunder app.social_accounts?