FormGroup Errors while submitting data to firebase


#1

Hello guys,
I have developed an app in Ionic 4 Beta, it submits data successfully to Firebase but am getting an error in cmd. Kindly check the attached.
Thanks in advance.err1

and here is my order.page.ts :point_down::point_down:

import { Component, OnInit } from '@angular/core';

import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { LoadingController, AlertController } from '@ionic/angular';
import { FirestoreService } from '../services/data/firestore.service';

@Component({
  selector: 'app-orders',
  templateUrl: './orders.page.html',
  styleUrls: ['./orders.page.scss'],
})
export class OrdersPage implements OnInit {

  **public createOrderForm: FormGroup;**
  constructor(
  	public loadingCtrl: LoadingController,
    public alertCtrl: AlertController,
    public firestoreService: FirestoreService,
    formBuilder: FormBuilder
  ) { 
	  	this.createOrderForm = formBuilder.group({
	    fullName: ['', Validators.required],
	    mobileNumber: ['', Validators.required],
	    email: ['', Validators.required],
	    company: ['', Validators.required],
	    serviceOrder: ['', Validators.required],
	    orderDescription: ['', Validators.required],
	  });
  }

  ngOnInit() {
  }

  async createOrder(){
  		const loading = await this.loadingCtrl.create();

  		const fullName = this.createOrderForm.value.fullName;
  		const mobileNumber = this.createOrderForm.value.mobileNumber;
  		const email = this.createOrderForm.value.email;
  		const company = this.createOrderForm.value.company;
  		const serviceOrder = this.createOrderForm.value.serviceOrder;
  		const orderDescription = this.createOrderForm.value.orderDescription;

  		this.firestoreService
  			.createOrder(fullName, mobileNumber, email, company, serviceOrder, orderDescription)
  			.then(
  				() => {
  					loading.dismiss().then(() => {
  						**this.router.navigateByUrl('');**
  				});
  			},

  			error => {
  				console.error(error);
  			}
  		);
  		return await loading.present();
  }

}

The lines in ** … ** are the ones having the err.