Q:

confirm failed: First argument "verification Code" must be a valid string

this is my error   first argument "verification id" must be a valid string.
Getting this error while trying to verify the Code please help
login.html
<ion-content padding>
    <div>
        <ion-grid>
            <ion-label style="font-size: 20px;"> Please enter your phone number </ion-label>
            <ion-row justify-content-center>
                <div *ngIf="!windowRef.confirmationResult">
                    <div [hidden]="user" style="margin-top:35px;">
                            <ion-item>
                                <ion-input type="tel" maxlength="10" [(ngModel)]="contactNumber" placeholder="Enter Your Phone Number" clearInput required></ion-input>
                            </ion-item>
                    </div>

                    <button style="background-color: #3880ff; width: 135px;height: 40px;border-radius:25px;font-size: 20px;margin: 35px;color: white;" type="submit" (click)="checkeUserExist()">Submit</button>
                </div>

                <div id="recaptcha-container"></div>

                <div *ngIf="windowRef.confirmationResult">
                    <hr>
                    <label for="code">Enter your Verification Code Here</label>
                    <input type="number" name="code" [(ngModel)]="verificationCode"><br><br><br><br>

                    <button style="background-color: #3880ff; width: 70px;height: 28px;" full type="submit" (click)="verifyLoginCode()">Verify</button><br><br><br>
                    <ion-label style="font-size: 18px;"> Resend code Again ! </ion-label><br><br>
                    <button style="background-color: #3880ff; width: 100px;height: 32px;" full type="submit" (click)="sendLoginCode(contactNumber)">Resend code</button>
                </div>
            </ion-row>  
        </ion-grid>
    </div>
</ion-content>

login.ts
ngOnInit() {
    this.windowRef = this.win.windowRef;
    this.windowRef.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('recaptcha-container', {
        //'type' : 'image',
        'size' : 'invisible',
        //'badge': 'inline' 
    });
    //this.windowRef.recaptchaVerifier.render();
}

sendLoginCode(contactNumber) {
    const appVerifier = this.windowRef.recaptchaVerifier;
    const num = "+91" + contactNumber;

    firebase.auth().signInWithPhoneNumber(num, appVerifier)
    .then(result => {
        this.windowRef.confirmationResult = result;
    })
    .catch( error => console.log(error) );
}

verifyLoginCode() {
    this.windowRef.confirmationResult
    .confirm(this.verificationCode)
    .then( result => {
        this.user = result.user;

        this.nav.navigateForward('addPatient');
    })
    .catch( error => console.log(error, "Incorrect code entered?"));
}

checkeUserExist() {
    var self = this;
    this.doctorUserCollection = this.db.collection('DoctorList').ref.where('contactNumber', '==', self.contactNumber)
    .get()
    .then(function(querySnapshot) {
        if(querySnapshot.empty) {
            self.nav.navigateForward(['/createAccount', { id: self.contactNumber }]);
        }
        else {
            querySnapshot.forEach(function(doc) {
                self.sendLoginCode(doc.data().contactNumber);
                localStorage.setItem('id', doc.data().uid);
            })
        }
    })

}

please tell me how to solve this 
Now, you need the verification code sent to login.
I get the verificationCode and verify it then error is coming.

LoginPage.html:32 ERROR L 
{
  code: "auth/argument-error", 
  message: "confirm failed: First argument "verificationCode" must be a valid string.", 
  ngDebugContext: DebugContext_, 
  ngErrorLogger: ƒ
}

A:

<input type="number" name="code" [(ngModel)]="verificationCode"><br><br><br><br>

The type of the input is "number".  Please remove the type attribute to make it work.
EDIT:
Otherwise you can parse verificationCode to string when calling 'confirm()'
this.windowRef.confirmationResult
.confirm(this.verificationCode)  <-- parse to string

