我有一个包含JSON的状态,如下所示:
{id: "1", name: "ig1", description: "ig 11"}
{id: "5", name: "hhh", description: "hhh"}
{id: "6", name: "ggg", description: "hhh"}
Run Code Online (Sandbox Code Playgroud)
我需要从状态数组中选择ID = 1的数据
如何使用NGXS状态选择器完成此操作
以及如何在组件中访问它?
我的状态如下
食谱
0 : {id: "3", name: "Cake", image: "index.jpg", description: "Lorem Ipsum is
simply dummy text of the printing a…ldus PageMaker including versions of
Lorem Ipsum.", ingredients: "ig 1-1kg,ig 123-4kg"}
1 : {id: "16", name: "gfdg", image: "Chrysanthemum.jpg", description:
"fhfgh",
ingredients: "gdfg-4sfhs,ig 1-1kg"}
2 : {id: "17", name: "hfgh", image: "Jellyfish.jpg", description: "ghgfh",
ingredients: …Run Code Online (Sandbox Code Playgroud)