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

l.Name.toLocaleLowerCase #50

Open
ChinmayDeyUI opened this issue Jan 21, 2020 · 2 comments
Open

l.Name.toLocaleLowerCase #50

ChinmayDeyUI opened this issue Jan 21, 2020 · 2 comments

Comments

@ChinmayDeyUI
Copy link

ChinmayDeyUI commented Jan 21, 2020

After I added your package in my project I got below error.
TypeError: undefined is not an object (evaluating 'l.Name.toLocaleLowerCase')

When I used your top20.json it works, but if I used my own json I got above error.
Your json is like
[{"Name": "Åland Islands","Value": "Åland Islands","Code": "AX","Id": 1 }]
and my json is like
[{"id":1,"city":"Kolkata","type":"Metro","city_class":"A","state":"West Bengal","state_id":2,"type_id":"M"}]

@Twelvefat
Copy link

Twelvefat commented Jan 28, 2020

you must include Name key to your Json. sorry for my bad english

it look like :
[{"Id":1,"Name":"Whatever"}]

@nericode
Copy link

nericode commented Nov 11, 2020

@ChinmayDeyUI You json is incorrect please use map function to convert json:

 var data = json.map((item) => {
    // item values can change, but no Id, Name, Value
     return {
        Id: item.Id,
        Name: item.city,
        Value: item.type,
     };
});

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

3 participants