Skip to content

Instantly share code, notes, and snippets.

@avatsaev
Created February 10, 2017 00:35
Show Gist options
  • Save avatsaev/5a895d624c6c4b717d31052ede12775e to your computer and use it in GitHub Desktop.
Save avatsaev/5a895d624c6c4b717d31052ede12775e to your computer and use it in GitHub Desktop.
<form (ngSubmit)="onSignUpSubmit()" #f="ngForm" >
<div class="row">
<div class="input-field col s12">
<input id="email"
type="email"
required
name='email'
[(ngModel)]="signUpUser.email"
class="validate">
<label for="email">Email</label>
</div>
<div class="input-field col s12">
<input id="password"
type="password"
required
name='password'
[(ngModel)]="signUpUser.password"
class="validate">
<label for="password">Password</label>
</div>
<div class="input-field col s12">
<input id="password_confirmation"
type="password"
required
name='password_confirmation'
[(ngModel)]="signUpUser.passwordConfirmation"
class="validate">
<label for="password_confirmation">Password confirmation</label>
</div>
<span *ngIf="signUpUser.password != signUpUser.passwordConfirmation"
style="color:red">
Passwords must match
</span>
<div class="col s12">
<button type="submit"
[disabled]="!(f.valid) || !(signUpUser.password == signUpUser.passwordConfirmation)"
class="waves-effect waves-light btn blue right">
Sign up
</button>
</div>
</div>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment