代码片段
angular.module("app.wallet", ["app.wallet.directive", "app.wallet.service"]),
angular.module("app.wallet.service", []).factory("$wallet", ["$rootScope", "$$http", "$e", "$toast", "errorMap", "$popup", "$google", function(t, e, n, a, r, o, i) {
var s = {};
return s.withdraw = function(t) {
var n = e.link({
method: "POST",
url: "/btc/withdraw",
data: {
amount: t.amount,
address: t.btcAddress
},
success: Do stuff
failure: Do other stuff
});
n.req()
}
,
s
}
]),
具体来说,我需要能够从 Chromes 控制台调用提款函数。
最佳答案
您可以使用angular.injector
angular.injector(['app.wallet']).get('$wallet').withdraw();
关于javascript - 我如何访问 Angular 模块内部的函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42882333/