asafdav / ng-csv

Simple directive that turns arrays and objects into downloadable CSV files
MIT License
572 stars 216 forks source link

Values with commas not following CSV specification #25

Closed felipesabino closed 10 years ago

felipesabino commented 10 years ago

The specification says that

  1. Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes

But this is currently not being respected: http://jsfiddle.net/8eA6V/1/

asafdav commented 10 years ago

Hi, Have you tried using the latest release of ng-csv ?

As far as I can see, your example is using an old copy that is stored on my github page. I didn't update the example there for a while.

On Thu, May 15, 2014 at 2:05 AM, Felipe Sabino notifications@github.comwrote:

The specification http://tools.ietf.org/html/rfc4180#page-2 says that

  1. Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes

    But this is currently not being respected: http://jsfiddle.net/8eA6V/1/

— Reply to this email directly or view it on GitHubhttps://github.com/asafdav/ng-csv/issues/25 .

Baracasfig commented 10 years ago

I tried to use the version 0.1.2, and the comma issue still persists.

Any idea?

asafdav commented 10 years ago

Got it, will push a fix soon

asafdav commented 10 years ago

Can you please check the latest version (master) ?

I'll release it in the next version soon

felipesabino commented 10 years ago

@asafdav I just replaced the resource in my earlier example fiddle and it does not seem to fire the download anymore: http://jsfiddle.net/8eA6V/2/

Do you know what might be happening? Btw, the script loads fine, as you can clearly see that the elements DOM have changed due to the transclusion...

asafdav commented 10 years ago

In this example you use angular 1.1.5 and promise.finally wasn't available back then.

I tried to change the version in your example and it solved it. anyway, I pushed a fix and master should work with angular 1.1.5 as well.

felipesabino commented 10 years ago

@asafdav the example url is pointing to the master build (using rawgithub) but it still does not trigger the promise, is it working for you?

asafdav commented 10 years ago

For some reason the promise is not fulfilled, I'll try looking into it. In the meantime, can you use angular 1.2+ ?

asafdav commented 10 years ago

OK, in this version $q.when works only after $scope.$apply, I pushed a fix and your example works now.