I am new to angular JS and I am trying to work out the following.
I am taking a CSV file as input from the user and sending it to the controller on clicking a submit button.
<button class="btn btn-primary" type="submit"ng-click="Input(File)">Submit</button>
My controller is as follows
$scope.Input = function(file)
{
var t = file.toString().split("\n");
var head = t[0].split(",");
console.log(head);
}
I am trying to print the header of the uploaded CSV file. But in the console I am getting ["[object File]"]
. Can someone help me on how to modify the code to get the header of uploaded csv file.