I’m not sure why you would want to do this, however: angular.toJson serializes input into a JSON-formatted string, whereas angular.fromJson deserializes a JSON string. So by doing angular.fromJson(angular.toJson(response)); you are converting the JSON object you are receiving into a deserialized string, then converting the string back into a JSON object. It’s the same as writing: var a = reponse;
Regarding your error: it means that the object you pass to angular.toJSON has a circular reference, something like:
var a = {};
a.b = a;
angular.toJSON cannot convert structures like this.