跳至主要內容

文章

顯示從 2月, 2023 起發佈的文章

ngrx 必要設定

 為了能夠在 reducer 裡面更動物件,必須要以下設定   StoreModule . forRoot (       { cart : cartReducer },       {         runtimeChecks : {           // strictStateImmutability and strictActionImmutability are enabled by default           strictStateSerializability : true ,           strictActionSerializability : true ,           strictActionWithinNgZone : true ,           strictActionTypeUniqueness : true ,           // if you want to change complexe objects and that we have. We need to disable these settings           // change strictStateImmutability, strictActionImmutability           strictStateImmutability : false , // set this to false           strictActionImmutability : false ,         }, ...

Angular Fire Firestore 使用經驗

 如何取得每筆資料的 ID 在valueChanges 加上 {idsField:[name]}   const u = this . firestore           . collection ( 'user' )           . valueChanges ({ idField : 'id' })           . subscribe (( v ) => {             console . log ( v );           });  如何用ID找到單筆資料   this . firestore           . doc ( 'user/' + 'AkWwJaYqfe7PoQfRhEPr' )           . valueChanges ()           . subscribe (( u ) => {             console . log ( u );           });

Module not found: Error: Default condition should be last one

這個問題發生在使用 Augular 加上 Firebase 時候發生的,不過有沒有用 Angular Fire 都會有這個錯誤,原因是出在 webpack 打包時,會去找每一個模組的 package.json 裡面的 exports,而裡面的 default 要在所轄物件的最後一個 property。 Google 的 firebase 套件許多地方都有這個問題,必須手動修正,希望 Google 能迅速修正這個問題。