Closed ArjunKumarDD closed 9 years ago
I also encountered crash(on chrome, firefox is totally ok), but it only happened on some big arrays, like 10000 rows , 5000 rows is fine. Any idea ?
See #33 I couldn't figure it out so far.
The Chrome crash is fixed by triggering the download using a object URL created from a blob. In the link function of the directive, set the href attribute like this:
var blob = new Blob([scope.csv],{ type: "text/csv;charset=utf-8;" }); ... downloadLink.attr('href', window.URL.createObjectURL(blob));
Using this method, it is no longer necessary to encode the data, so additional changes were required. Full changes here:
https://github.com/bbarney/ng-csv/commit/49e5cfcf38e550979c4f8bbad2c3e14f11523da4
The current stable version of PhantomJS doesn't support the Blob object yet so I disabled the unit test that was failing. It will pass after upgrading to PhantomJS 2.0.
Can you please provide an example ?