diff options
author | Chocobozzz <me@florianbigard.com> | 2019-05-29 11:03:01 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-05-29 11:19:54 +0200 |
commit | 1d5342abc43df02cf0bd69b1e865c0f179182eef (patch) | |
tree | f008b43ca8189ee5856e39e5b9d4800bf37f9575 /client/src/app/signup/signup-step-user.component.ts | |
parent | e590b4a512617bbf63595b684386f68abea7d8b8 (diff) | |
download | PeerTube-1d5342abc43df02cf0bd69b1e865c0f179182eef.tar.gz PeerTube-1d5342abc43df02cf0bd69b1e865c0f179182eef.tar.zst PeerTube-1d5342abc43df02cf0bd69b1e865c0f179182eef.zip |
Multi step registration
Diffstat (limited to 'client/src/app/signup/signup-step-user.component.ts')
-rw-r--r-- | client/src/app/signup/signup-step-user.component.ts | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/client/src/app/signup/signup-step-user.component.ts b/client/src/app/signup/signup-step-user.component.ts new file mode 100644 index 000000000..54855d8a7 --- /dev/null +++ b/client/src/app/signup/signup-step-user.component.ts | |||
@@ -0,0 +1,37 @@ | |||
1 | import { Component, EventEmitter, OnInit, Output } from '@angular/core' | ||
2 | import { AuthService } from '@app/core' | ||
3 | import { FormReactive, UserValidatorsService } from '../shared' | ||
4 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
5 | import { FormGroup } from '@angular/forms' | ||
6 | |||
7 | @Component({ | ||
8 | selector: 'my-signup-step-user', | ||
9 | templateUrl: './signup-step-user.component.html', | ||
10 | styleUrls: [ './signup.component.scss' ] | ||
11 | }) | ||
12 | export class SignupStepUserComponent extends FormReactive implements OnInit { | ||
13 | @Output() formBuilt = new EventEmitter<FormGroup>() | ||
14 | |||
15 | constructor ( | ||
16 | protected formValidatorService: FormValidatorService, | ||
17 | private authService: AuthService, | ||
18 | private userValidatorsService: UserValidatorsService | ||
19 | ) { | ||
20 | super() | ||
21 | } | ||
22 | |||
23 | get instanceHost () { | ||
24 | return window.location.host | ||
25 | } | ||
26 | |||
27 | ngOnInit () { | ||
28 | this.buildForm({ | ||
29 | username: this.userValidatorsService.USER_USERNAME, | ||
30 | password: this.userValidatorsService.USER_PASSWORD, | ||
31 | email: this.userValidatorsService.USER_EMAIL, | ||
32 | terms: this.userValidatorsService.USER_TERMS | ||
33 | }) | ||
34 | |||
35 | setTimeout(() => this.formBuilt.emit(this.form)) | ||
36 | } | ||
37 | } | ||