bahaaldine / angular-csv-import

Angular component that lets you import and convert CSV file to JSON
MIT License
150 stars 89 forks source link

Header and separator disapear fix not in bower #22

Open Aldises opened 9 years ago

Aldises commented 9 years ago

Hi,

I've seen that you've fix the library in a way that header and separator can't disapear... but still when I install your awersome plugin bower still give me the ancient version without the fix.

I use : bower install angualr-csv-import --save as command.

Thanks for your help

bahaaldine commented 9 years ago

Hi @Aldises I've updated the bower version, can you please confirm it's fixed?

gregjewell commented 9 years ago

I've got the same issue. Installed the library yesterday.

For me, when the page initializes and tries to display your component, it checks these values, which are undefined and then cast to false. Nothing then overwrites them.

scope.separatorVisible = scope.separatorVisible || false;
scope.headerVisible = scope.headerVisible || false;

If I define the following in my own directive:

scope.csv = {
    content: null,
    header: true,
    headerVisible: true,
    separator: '&',
    separatorVisible: true,
    result: null
  };

separator is updated in your library to be "&", but headerVisible and separatorVisible are still false, despite me setting them to true. Even after uploading a file and triggering a breakpoint on the "element.on('change'" function, headerVisible and separatorVisible still have not been overridden by my values

bahaaldine commented 9 years ago

Hey @gregjewell, can you please confirm this is working now?

I've set the scope variable in the example with both headerVisible & separatorVisible, and it works:

$scope.csv = {
        content: null,
        header: true,
        headerVisible: true,
        separator: ',',
        separatorVisible: true,
        result: null,
        encoding: 'ISO-8859-1',
        encodingVisible: true,
    };