Charlie-Greenman
Charlie-Greenman

Reputation: 1669

How do I change the value of an input field in angular using ngrx/store

I have a backgroundHex key/value in my ngrx/store for my colors object. So to access it in my app I would do the following {{(colors | async).backgroundHex)}}

The above works quite well, but when it comes to input fields I've been having a hard time finding the right syntax in a timely fashion and I was wondering if someone could help. I've tried value, ngModel, and ngModelChanged(perhaps not in the right way).

Any help would be incredibly helpful. Thank you.

Upvotes: 0

Views: 865

Answers (1)

Charlie-Greenman
Charlie-Greenman

Reputation: 1669

It turns out that it is really simple. Assuming you have the store properly hooked up into the component, the following is will work:

value="{{(colors | async).backgroundRed}}"

Upvotes: 0

Related Questions