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

Update Object Array via config.set #42

Open
jonasjohansson opened this issue Apr 29, 2018 · 1 comment
Open

Update Object Array via config.set #42

jonasjohansson opened this issue Apr 29, 2018 · 1 comment

Comments

@jonasjohansson
Copy link

jonasjohansson commented Apr 29, 2018

const items: [
  {'data1':true},
  {'data2':false}
]

How can I config.set('items[0].data1',false)?

Currently, I do config.get('items') and loop through updating the values and then doing config.set('items') which works but feels backward.

@waltoncon
Copy link

I know this is an old issue, but someone might find this helpful.

Instead of:

config.set('items[0].data1', false)

Do

config.set('items.0.data1', false)

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

2 participants