This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Converts an object into a key/value par with an optional prefix. Used for converting objects to a query string */ | |
var qs = function(obj, prefix){ | |
var str = []; | |
for (var p in obj) { | |
var k = prefix ? prefix + "[" + p + "]" : p, | |
v = obj[k]; | |
str.push(angular.isObject(v) ? qs(v, k) : (k) + "=" + encodeURIComponent(v)); | |
} | |
return str.join("&"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var objectToQueryString = function (a) { | |
var prefix, s, add, name, r20, output; | |
s = []; | |
r20 = /%20/g; | |
add = function (key, value) { | |
// If value is a function, invoke it and return its value | |
value = ( typeof value == 'function' ) ? value() : ( value == null ? "" : value ); | |
s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value); | |
}; | |
if (a instanceof Array) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rx.Observable.prototype.scan = function (/* [seed], accumulator */) { | |
var hasSeed = false, seed, accumulator, source = this; | |
if (arguments.length === 2) { | |
hasSeed = true; | |
seed = arguments[0]; | |
accumulator = arguments[1]; | |
} else { | |
accumulator = arguments[0]; | |
} | |
return Rx.Observable.createWithDisposable(function (observer) { |