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

The setting the separator property to a comma is causing an error #3

Closed
aventuratech opened this issue Nov 24, 2014 · 2 comments
Closed

Comments

@aventuratech
Copy link

I consistently get the following error when I set the separator property to "," as is is in the readme file.

Error: [$parse:syntax] Syntax Error: Token ',' not a primary expression at column 1 of the expression

This is the code sample I am using:

<ng-csv-import content="csv.content"
    header="true" 
    separator=","
    result="csv.result"></ng-csv-import>

The plugin does seem to work besides that when the separator property is not set since csv.content and csv.result are being loaded into $scope

@bahaaldine
Copy link
Owner

That's normal, since the nv-csv-import directive is expecting an expression for the separator scope variable. Thus if you want to pass the separator as a string you may use the following syntax and use single quotes:

<ng-csv-import content="csv.content"
    header="true" 
    separator="','"
    result="csv.result"></ng-csv-import>

@aventuratech
Copy link
Author

Thanks for clarifying!

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