Created
August 27, 2014 06:37
-
-
Save kanakiyajay/4fb35ad937b35c5c623d to your computer and use it in GitHub Desktop.
Angular | output prettified JSON output with whitespaces and newlines
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
function toJson(obj) { | |
return JSON.stringify(obj, function(k,v) { return v; }, ' ') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment