dist/sdk.js
function decorateSend(q, scope, transport) {
        var original = transport.send;
        transport.send = function (options) {

            // Store originals
            var defer = q.defer(),
                onSuccess = options.successCallback || angular.noop,
                onError = options.errorCallback || angular.noop;

            options.successCallback = function (result) {
                scope.$apply(function () {
                    defer.resolve(result);
                    onSuccess(result);
                });
            };

            options.errorCallback = function (result) {
                scope.$apply(function () {
                    defer.reject(result);
                    onError(result);
                });
            };

            // Call the original transport method
            // but use our promise as the return value
            original.call(transport, options);
            return defer.promise;
        };
    }
function decorateSend(q, scope, transport) {
        var original = transport.send;
        transport.send = function (options) {

            // Store originals
            var defer = q.defer(),
                onSuccess = options.successCallback || angular.noop,
                onError = options.errorCallback || angular.noop;

            options.successCallback = function (result) {
                scope.$apply(function () {
                    defer.resolve(result);
                    onSuccess(result);
                });
            };

            options.errorCallback = function (result) {
                scope.$apply(function () {
                    defer.reject(result);
                    onError(result);
                });
            };

            // Call the original transport method
            // but use our promise as the return value
            original.call(transport, options);
            return defer.promise;
        };
    }
function decorateSend ( q , scope , transport ) { var original = transport . send ; transport . send = function ( options ) { // Store originals var defer = q . defer ( ) , onSuccess = options . successCallback || angular . noop , onError = options . errorCallback || angular . noop ; options . successCallback = function ( result ) { scope . $apply ( function ( ) { defer . resolve ( result ) ; onSuccess ( result ) ; } ) ; } ; options . errorCallback = function ( result ) { scope . $apply ( function ( ) { defer . reject ( result ) ; onError ( result ) ; } ) ; } ; // Call the original transport method // but use our promise as the return value original . call ( transport , options ) ; return defer . promise ; } ; }
Modifies transport.send to return promises.

@param {Object} q
@param {Object} scope
@param {Object} transport
Modifies transport . send to return promises .