Skip to content

Header varible is flipped each file change. #41

Open

Description

@Scrambles56

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;
        }
    });

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions