だから私はメインモジュールを次の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
つまり、サブモジュールで絶対を使用したいapp.social_accounts
。
しかし、私がAlbum
(下に登録されapp.social_accounts
た) を下に注入するcontroller
DashboardCtrl
とapp
、リクエストはに送信されましたhttp://localhost:8000/app/me/albums/
。
だから私はここで何が起こっているのだろうか、そしてどのように下で別のものを達成するのだろurl
うrestmod
かapp.social_accounts
?