Question: **pay.service.ts**

```
  @ViewChild('cardElementForm', { static: false }) cardElementForm: ElementRef;
  stripe = Stripe(environment.stripe.pubKey);

  async createStripeForm() {
    const stripeElements = this.stripe.elements();
    const cardElement = stripeElements.create('card');
    cardElement.mount(this.cardElementForm.nativeElement);
  }

```

Edit: added more code. This is my service that im importing into my page.ts 

**page.html**

```
 <form #saveCard="ngForm" class="saveCardForm">
              <ion-item>
                <div id="cardElementForm" #cardElementForm></div>
                <ion-text *ngIf="error">{{ error }}</ion-text>
              </ion-item>
              <ion-item>
                <ion-text (click)="this.payments.createStripeForm()">Create form</ion-text>
              </ion-item>
              <ion-item>
                <ion-text (click)="this.payments.saveCard()">Send data</ion-text>
              </ion-item>
            </form>

```

**page.ts**

```
import { Pay } from '../services/pay.service';

```

I get error:

```
TypeError: this.cardElementForm is undefined

```

Wheres the problem? Im stuck at this.

Answer: 
In my case I saw some errors in terminal when I run ng test but when browser open it shown no specs found.

ERROR IN PROJECT

[![enter image description here](https://i.stack.imgur.com/Eqti9.png)](https://i.stack.imgur.com/Eqti9.png)

this was the error. After fixed the above error it showed all the specs with the result of executed test cases
I had a similar issue and apparently it was due to an invalid import.   

This was the specific import:
`import 'rxjs/add/observable/throw'`

I just removed the import and everything worked fine.

ng test seemed to execute just fine, so it was a little confusing.