假设我在 ngrx/store 中有以下数据
{
"id": 1,
"containers": [
{
"id": 1.1,
"x": 10,
"y": 40
},
{
"id": 1.2,
"x": 40,
"y": 30
}
]
}
下面是UI中的代码
<button type="button" (click)='onclick(x, y)'></button>
onclick(x, y){
// For example if the value x and y are 20 and 20 then i want the update the json in ngrx store like this
{
"id": 1,
"containers": [
{
"id": 1.1,
"x": 20,
"y": 20
},
{
"id": 1.2,
"x": 20,
"y": 20
}
]
}
}
我怎样才能达到这个结果,以便我可以在 ngrx 商店中更新相同的内容