0
メール/電話番号とパスワードのパターンを追加しようとしています。どのようにパターンが期待どおりに機能しないか。イオン2または角度2 htmlページレベルのメールとパスワードの検証
<form (ngSubmit)="onSubmit()" #signInForm="ngForm">
<ion-list padding-bottom>
<ion-item>
<ion-input type="text" placeholder="Email/Phone number" required #name="ngModel"
[(ngModel)]="email" pattern="^(?!^[.])([-'a-zA-Z0-9_]+\\.)*[-'a-zA-Z0-9_][email protected](?!\\.+)([-a-zA-Z0-9]+\\.)+[a-zA-Z]{2,}$""></ion-input>
<div [hidden]="email.valid"
class="alert alert-danger">
Email is required and Email or Phone number pattern is wrong.
</div>
</ion-item>
<ion-item>
<ion-input type="password" id="password"
required
[(ngModel)]="password" name="password"
#name="ngModel" placeholder="Password" pattern="(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[[email protected]#\$%\^&])(?=.{8,})">
<div [hidden]="password.valid"
class="alert alert-danger">
Password is required and must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters.
</div>
</ion-input>
</ion-item>
<p float-right (click)="forget()">Forget Password?</p>
<button ion-button color="secondary" [disabled]="!signInForm.form.valid" round (click)="login()" float-left>Proceed</button>
</ion-list>
</form>