Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header varible is flipped each file change. #41

Open
Scrambles56 opened this issue Mar 29, 2016 · 0 comments
Open

Header varible is flipped each file change. #41

Scrambles56 opened this issue Mar 29, 2016 · 0 comments

Comments

@Scrambles56
Copy link

When ever you change CSV file, the Library actually changes the users Header configuration.
The $scope.$watch in the following code should really NEVER trigger, as this is a user configuration, and this configuration should be considered as a non-mutable ruleset, but every time you change file.

    var csvShouldUseHeader = false;
    $scope.csv = {
        separator: ",",
        header: csvShouldUseHeader,
        accept: '.csv'
    };


    $scope.$watch("csv.header", function(newValue){
        if(newValue !== csvShouldUseHeader){
            //This log shows that some bad behaviour is happening from with the library.
            console.log("We are trying to change the header property to something we didn't specify", newValue);
            //The following line corrects the header property back to what we have specified. A user fix to the library that really shouldnt be needed.
            $scope.csv.header = csvShouldUseHeader;
        }
    });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant