I don't know how can I convert my string data in $scope.fileContent ( I got it from my CSV file) in array. I printed my $scope.fileContent:
console.log($scope.fileContent) =
heading1,heading2,heading3,heading4,heading5
value1_1,value2_1,value3_1,value4_1,value5_1
value1_2,value2_2,value3_2,value4_2,value5_2
But I would like a function to convert it to a array like this:
[
{ heading1:"value1_1",heading2:"value2_1",heading3:"value3_1",heading4:"value4_1",heading5:"value5_1" }
{ heading1:"value1_2",heading2:"value2_2",heading3:"value3_2",heading4:"value4_2",heading5:"value5_2" }
]
Any ideia of how to implement it in Angularjs?
I saw some examples but I didn't get with that, I guess the most releant is this.