MCPcopy Create free account
hub / github.com/apache/struts-examples / toJson

Function toJson

rest-angular/src/main/webapp/js/lib/angular/angular.js:1259–1265  ·  view source on GitHub ↗

* @ngdoc function * @name angular.toJson * @module ng * @kind function * * @description * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be * stripped since angular uses this notation internally. * * @param {Object|Array|Date|string|number} obj Inp

(obj, pretty)

Source from the content-addressed store, hash-verified

1257 * @returns {string|undefined} JSON-ified string representing `obj`.
1258 */
1259function toJson(obj, pretty) {
1260 if (isUndefined(obj)) return undefined;
1261 if (!isNumber(pretty)) {
1262 pretty = pretty ? 2 : null;
1263 }
1264 return JSON.stringify(obj, toJsonReplacer, pretty);
1265}
1266
1267
1268/**

Callers 5

stringifyFunction · 0.70
serializeValueFunction · 0.70
$HttpProviderFunction · 0.70
stringifyFunction · 0.70
jsonFilterFunction · 0.70

Calls 2

isUndefinedFunction · 0.70
isNumberFunction · 0.70

Tested by

no test coverage detected