Searching Data From Different Component in Angular NGXS

后端 未结 1 1118
野的像风
野的像风 2021-01-22 18:00

I\'m trying to figure out how will i able to search in NGXS from different component. I have my searchbar from the navbar component while i\'m displaying my data from app compon

相关标签:
1条回答
  • 2021-01-22 18:30

    Having a look at your StackBlitz, it seems you are trying to filter a list based on what is entered in the peopleForm input element.

    Rather than tryring to select from the store when this value changes in the component, I've found a good way to model this problem is to store the 'search text' in the state, and use a @Selector that applies the current search value to the list returns those items that meet the criteria.

    Take a look at this answer where I've outlined this approach.

    0 讨论(0)
提交回复
热议问题