skip to Main Content

Firebase – how can i use serverTimestamp in angular/Fire in the compat mode

I have tried import firebase from 'firebase/compat/app'; import 'firebase/compat/firestore'; const firestore = firebase.firestore; this.form = this.builder.group({ items:[data.items, null], dateReported:[firestore.FieldValue.serverTimestamp(), Validators.required], ....}) i get this error: ERROR FirebaseError: Function WriteBatch.update() called with invalid data. Unsupported field value: a custom sl object…

VIEW QUESTION

Reactjs – How to acheive react onchange event in angular with ngModelChange

html: <mat-form-field appearance="outline"class="inputBox"> <input matInput name="total" placeholder="0.00" [ngModel]="total" (ngModelChange)="handleOnChange('total', $event)" /> </mat-form-field> TS: public handleOnChange = (field, e) => { console.log("hell", field) this.total=90 } the value of this.total should remain constant at 90 after any change event triggers the handleOnChange…

VIEW QUESTION

Javascript – Why is this expression evaluation to undefined, even though debugging it shows the correct value?

I have this code in my .ts file: fileUpload(file:UploadedFile){ var imagesource = `data:${file.Type};base64, ${file.Data}`; this.srcPreview = this.sanitizer.bypassSecurityTrustUrl(imagesource); } When an image is first uploaded imagesource always evaluates to "data:image/png;base64, undefined". However, if I add a breakpoint before the end of…

VIEW QUESTION
Back To Top
Search