* @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 AngularJS uses this notation internally. * * @param {Object|Array|Date|string|number|boolea
(obj, pretty)
| 1412 | * See https://github.com/angular/angular.js/pull/14221 for more information. |
| 1413 | */ |
| 1414 | function toJson(obj, pretty) { |
| 1415 | if (isUndefined(obj)) return undefined; |
| 1416 | if (!isNumber(pretty)) { |
| 1417 | pretty = pretty ? 2 : null; |
| 1418 | } |
| 1419 | return JSON.stringify(obj, toJsonReplacer, pretty); |
| 1420 | } |
| 1421 | |
| 1422 | |
| 1423 | /** |
no test coverage detected