I'm new to AngularJS and JSON. I'm stuck in this stage where I want to filter unnecessary fields in the JSON.
I used code in my controller :
var data = $scope.choices; // Is an array
var datav = (JSON.stringify(data)); // array converted into a string need to be filtered
alert(datav);
If I alert(datav) am getting JSON data which mentioned below.
[{"title":"g","$$hashKey":"object:3"},{"id":"choice2","$$hashKey":"object:6","title":"ghgh"},{"id":"choice3","$$hashKey":"object:11","title":"fgh"}]
I want only "title" I don't want $$hashKey and id. How to do this?
.map()to return only what you want