I have an angular array $scope.items that I want to convert to a json object. I've been trying to convert it using JSON.stringify() but it always returns with a []
Here's my code:
$scope.items = [];
var scopeItems = {};
scopeItems = JSON.stringify($scope.items);
console.log(scopeItems);
I'm using this link as a reference in my code.
What am I doing wrong here?
Thank you for anyone that can help me!
"[]"whats strange there{}, arrays with[].[ ]without any values at all. Sorry for the confusion.