Exporting http object to use it through clobbers target defined in plugins.xml.

Doing this helps in using the plugin through ngCordova, a much better way of using Cordova plugins from Angular.
This commit is contained in:
Sai Krishna
2014-10-29 10:27:34 +00:00
parent 4fc676cc67
commit 978708890b
+3 -1
View File
@@ -63,6 +63,8 @@ var http = {
}
};
module.exports = http;
if (typeof angular !== "undefined") {
angular.module('cordovaHTTP', []).factory('cordovaHTTP', function($timeout, $q) {
function makePromise(fn, args, async) {
@@ -126,4 +128,4 @@ if (typeof angular !== "undefined") {
});
} else {
window.cordovaHTTP = http;
}
}