Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 4.76 KB | None | 0 0
  1. <card [title]="'Create your account'" [align]="'center'">
  2.   <form [formGroup]="form" (ngSubmit)="onSubmit()">
  3.     <md-input-container>
  4.       <input mdInput placeholder="Email address" [formControl]="form.controls['email']" type="email">
  5.       <br />
  6.       <small *ngIf="form.controls['email'].hasError('required') && form.controls['email'].touched"
  7.             class="form-message text-danger">You must include an email address.
  8.       </small>
  9.       <small *ngIf="form.controls['email'].errors?.email && form.controls['email'].touched"
  10.             class="form-message text-danger">You must include a valid email address.
  11.       </small>
  12.     </md-input-container>
  13.     <md-input-container>
  14.       <input mdInput placeholder="Password" [formControl]="form.controls['password']" type="password">
  15.       <br />
  16.       <small *ngIf="form.controls['password'].hasError('required') && form.controls['password'].touched"
  17.             class="form-message text-danger">You must include password.
  18.       </small>
  19.     </md-input-container>
  20.     <md-input-container>
  21.       <input mdInput placeholder="Confirm Password" [formControl]="form.controls['confirmPassword']" type="password">
  22.       <br />
  23.       <small *ngIf="form.controls['confirmPassword'].hasError('required') && form.controls['confirmPassword'].touched"
  24.             class="form-message text-danger">You must include confirm password.
  25.       </small>
  26.       <small *ngIf="form.controls['confirmPassword'].errors?.equalTo" class="form-message text-danger">Passwords do not
  27.         math.
  28.       </small>
  29.     </md-input-container>
  30.  
  31.     <div class="row">
  32.       <div class="col col-12">
  33.         <md-radio-group formGroup="companyMethod">
  34.           <md-radio-button class="example-margin" name="user"  [value]=false (click)="setUserOrCompanyMethodType(TestMethodType.User)">User
  35.               {{TestMethodType.user}}
  36.           </md-radio-button>
  37.           <md-radio-button class="example-margin" name="company" [value]=true (click)="setUserOrCompanyMethodType(TestMethodType.Company)">Company
  38.             {{TestMethodType.company}}
  39.           </md-radio-button>
  40.         </md-radio-group>
  41.       </div>
  42.     </div>
  43.  
  44.   <div class="row" formGroup="user" *ngIf="form.controls.companyMethod.controls.type.value === TestMethodType.User">
  45.       <div class="col col-12">
  46.         <md-input-container>
  47.             <input type="text" mdInput placeholder="Name Company" [formControl]="form.controls['companyName']" formControlName="companyName">    
  48.           </md-input-container>
  49.           <md-input-container>
  50.               <input type="text" mdInput placeholder="Address" [formControl]="form.controls['companyAddress']">    
  51.           </md-input-container>
  52.           <md-input-container>
  53.               <input type="text" mdInput placeholder="Phone" [formControl]="form.controls['companyPhone']">    
  54.           </md-input-container>
  55.       </div>
  56.     </div>
  57.     <div class="row" formGroup="company" *ngIf="form.controls.companyMethod.controls.type.value === TestMethodType.Company" >
  58.         <div class="col col-12">
  59.           <md-input-container>
  60.             <input type="text" mdInput placeholder="Name Company" [formControl]="form.controls['companyName']" formControlName="companyName">
  61.             <small *ngIf="!form.controls.companyMethod.controls.company.controls.companyName.valid">
  62.             required
  63.             </small>    
  64.           </md-input-container>
  65.           <md-input-container>
  66.               <input type="text" mdInput placeholder="Address" [formControl]="form.controls['companyAddress']" formControlName="companyAddress">
  67.               <small *ngIf="!form.controls.companyMethod.controls.company.controls.companyAddress.valid">
  68.               required
  69.               </small>    
  70.           </md-input-container>
  71.           <md-input-container>
  72.             <input type="text" mdInput placeholder="Phone" [formControl]="form.controls['companyPhone']" formControlName = "companyPhone">    
  73.             <small *ngIf="!form.controls.companyMethod.controls.company.controls.companyPhone.valid">
  74.               required
  75.             </small>
  76.             </md-input-container>
  77.       </div>
  78.     </div>
  79.     <div>
  80.       <md-checkbox [formControl]="form.controls['agreeWithTerms']">
  81.         I have read and agree to the terms of service.
  82.       </md-checkbox>
  83.       <br />
  84.       <small *ngIf="form.controls['agreeWithTerms'].hasError('required') && form.controls['agreeWithTerms'].touched"
  85.            class="form-message text-danger">You must include an email address.
  86.       </small>
  87.     </div>
  88.  
  89.       <button md-raised-button color="accent" type="submit" [disabled]="(!form.valid)">Submit</button>
  90.  
  91.  
  92.     <div class="additional-info">
  93.       Already have an account?
  94.       <a routerLink="/account/signin">Sign in</a>
  95.     </div>
  96.   </form>
  97. </card>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement