ngrx form 中 reset 方法僅只有 reset untouched,unsubmitted,但我們在Action 中定義ngrx form 的模板

ngrx form 中 reset 方法僅只有 reset untouched,unsubmitted

但我們在Action 中定義ngrx form 的模板

Reset Form Action - 用來reset 整個form 到 init 的狀態

可以看到Reset僅會reset這些狀態
所以在resetform 要改成initalState 就可以 包含error...等其他所有狀態回到init狀態


-------------------
20231123 更新

return initialState 會連同userdefinedProperties 一啟清掉
所以reset(setvalue(state,initialState))的寫法還是會有應用的時候
依照我們目前的情境
一種是 search form clear 時
一樣寫 return reset(setvalue(state,initialState))
但dialog 的關閉 清空 就需要寫
return initState