alberthaff / ngx-papaparse

Papa Parse wrapper for Angular
https://alberthaff.dk/projects/ngx-papaparse/docs/v8
MIT License
90 stars 19 forks source link

Assign CSV results while complete callback triggered, but results are blank #73

Closed weilies closed 3 years ago

weilies commented 3 years ago

I have my "complete" callback assigned results to a component level varible ...

  parseCsvFile(file) {
    this.papa.parse(file, {
      header: true,
      dynamicTyping: true,
      skipEmptyLines: "greedy",
      worker: true,
      complete: this.onPapaParseComplete
    });
  }

   onPapaParseComplete(results) {
    console.log("Completed Results", results);
    this.rosterCSVData = results.data
...
  onUploadRoster() {
    console.log(this.rosterCSVData) ===> NULL
  }
}

I import file and confirmed the data in csv. But later call onUploadRoster(), the result is blank. How come?