Here is a snippet of AngularJS code for a wallet module:
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: Perform certain actions here
failure: Handle errors here
});
n.req()
}
,
s
}
]),
If you need to call the withdraw function from Chrome's console, make sure to have all dependencies injected properly.