I have task (auth): All data should be stored in LocalStorage. Application should be written without back-end languages or services You should create a json file with 10 test users and get it content while application forming. Save user to LocalStorage.
I create a json file with data of users, but i don't understand how to fetch it in my service.
{
"Users": [
{
"Id": 1,
"name": "FirstUser",
"email": "[email protected]",
"password": "test123"
},
{
"Id": 2,
"name": "2thUser",
"email": "[email protected]",
"password": "test123"
}
]
}
I tried some tricks like
"import as data from '../shared/users.json' (error on Users)
"const users = data.Users"
Do you have idea "how to" ?