asafdav / ng-csv

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

[$rootScope:inprog] $digest already in progress #40

Open storkme opened 10 years ago

storkme commented 10 years ago

Hi,

I am aware that this is a duplicate of issue #18, but I have encountered the same issue.

I am 90% sure that the error I'm seeing is because of an unfortunate interaction between angular bootstraps 'typeahead' directive and this directive. I believe that the bootstrap directive registers a click listener on the document which then calls $digest. Please see this link: https://github.com/angular-ui/bootstrap/blob/master/src/typeahead/typeahead.js#L306

I'm somewhat of an angular novice, so I have no idea what the best resolution is for this issue.

If there's anything else I can provide please let me know.

Thanks.

asafdav commented 10 years ago

Can you please share a plunker of jsfiddle? I'll try to look into it

asafdav commented 10 years ago

I'd like to help you and figure it out, but I need to see your example because I can't reproduce it on my side. thanks in advance

storkme commented 10 years ago

Hi,

Sorry for the late response. I've been trying to recreate the test case as a jsfiddle but all I've got so far just seems to crash jsfiddle, which isn't ideal: http://jsfiddle.net/bEG5L/9/

EDIT: Got it working as a plunkr, though this still isn't exhibiting the same problematic behaviour I'm seeing http://plnkr.co/edit/HPWVHy3VYFN5s7FARy14?p=preview

Will update this issue thread if I find something..

asafdav commented 10 years ago

Cool, I'll go over your plunker, hope to solve it ASAP.

Thanks again

asafdav commented 10 years ago

Sorry for the late response, I noticed that your plunker uses an old version of ng-csv, have you tried using the latest version ?