I have a simple input control I want to validate using Angular Forms validation, e.g.
<form>
<ion-input type="tel" id="phoneNumber" name="phoneNumber" required [(ngModel)]="phoneNumber" maxlength="10" minlength="10"
placeholder="Touch here to enter a phone number" class="form-control">
</ion-input>
<p *ngIf="!phoneNumber.pristine && phoneNumber.errors.required" style="color:red;">
* Phone number is required.
</p>
<button ion-button block large full (ngSubmit)="placeOrder()">Place order</button>
</form>
I'm trying to follow along with Angular's documentation for template-driven forms: https://angular.io/guide/forms
Problem I'm having is that as soon as the browser hits the page, the browser just hangs, and only way out is to end the browser process. A CPU core will spike and the memory will keep increasing to more than 1GB within a minute. This is an Ionic 3 application with Angular 4. I've added the FormsModule to my app.module.ts file.
Any ideas why this would be happening?
I've found that when I remove either of the conditions inside my *ngIf, the issue does not occur (although obviously there is no validation then).