1Use this method, Input to be serialized into JSON.
2
3 var temp;
4 temp = angular.toJson(obj,pretty);
5 console.log(temp);
6
7 //pretty(optional).If set to true, the JSON output will contain newlines and whitespace.
8 If set to an integer, the JSON output will contain that many spaces per indentation.
9 (default: 2)